首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
parisman
2026年3月22日 20:51
求S(n) 题解:c语言快速幂
P1500
回复 0
|
赞 6
|
浏览 240
#include<stdio.h> typedef long long ll; ll quick_mul(int x){ int n=5; ll ans=1; while(n!=1){ if(n&1){//不管n奇数偶数,x翻倍,n变一半。n为奇数成一个剁成x; &n...
太一
2026年3月16日 17:45
求S(n) 题解:
P1500
回复 0
|
赞 16
|
浏览 424
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; int main() { int n; while (cin >> n) { int sum = 1; &nbs...
fuuuuuu
2026年3月14日 20:15
求S(n) 题解:
P1500
回复 1
|
赞 5
|
浏览 345
//unsigned long long可以通过呀 #include<bits/stdc++.h> using namespace std; int main(){ unsigned long long a; while(cin>>a){ int b=a%3; cout<<b<<endl; ...
ZeroQi_404
2026年3月12日 19:47
求S(n) 题解:
P1500
回复 0
|
赞 3
|
浏览 250
#include <iostream> using namespace std; int main(){ long long n; while(cin >> n){ cout << n % 3 << endl; } return 0; }
Jinx_K
2026年3月10日 19:57
求S(n) 题解:10 line
P1500
回复 0
|
赞 4
|
浏览 270
#include <cstdio> #include <cmath> #include <string> #include <iostream> using namespace std; int main() { int n; while(scanf("%d",&n)!=EOF) { int mod=n%3; cout<<(mod*mod*mod*mod*mod)%3<<endl; } return 0; }
白米饭607
2026年3月5日 18:05
求S(n) 题解:
P1500
回复 0
|
赞 28
|
浏览 566
/*是这么个逻辑 一个数%3只有三种可能 0 1 2 如果n%3==0 则n^5%3也会等于0; n^5可以看作n*n^4 3是一个奇数 如果%3等于1那么这个数必定是奇数 如果%3等于2 那么必定是一个偶数。 总结下来就是这么个逻辑 一个数 1.可以整除3 则输出0 2.不可以整除3 则分为(1)是奇数 则输出2 (2)是偶数 则输出1 正好与n直接%3的结果相等 */ #include <stdio.h> int main(){ &nb...
bro
2026年2月21日 15:30
求S(n) 题解:
P1500
回复 0
|
赞 10
|
浏览 400
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin >> n){ int temp = ((n%3)*(n%3)*(n%3)*(n%3)*(n%3))%3; cout << temp << endl; } ...
yauqq
2026年2月5日 14:37
求S(n) 题解:
P1500
回复 0
|
赞 2
|
浏览 415
#include<bits/stdc++.h> using namespace std; int main(){ long long n; while(cin>>n){ cout<<n%3<<endl; } return 0; }
mlx
2026年1月31日 12:10
求S(n) 题解:
P1500
回复 0
|
赞 3
|
浏览 440
#include<iostream> using namespace std; typedef unsigned long long ull; ull kmi(ull a,ull b,ull mod) { ull res=1%mod; while(b) { if(b&1) res=(res*a)%mod; a=(a*a)%mod; b>>=1; } return res; } int main() { ull n; while(cin>>n) { co...
xsw
2026年1月31日 09:18
求S(n) 题解:
P1500
回复 0
|
赞 3
|
浏览 443
#include<iostream> using namespace std; typedef long long LL; int qmi(int a, int b, int p) { int res = 1 % p; while (b) { if (b & 1) res = (LL) res * a % p; a = (LL) a * a % p; b >>= 1; } return res; } int main() { int x; while (cin >> ...
1
2
3
4
题目
求S(n)
题解数量
31
发布题解
在线答疑
热门题解
1
求S(n) 题解:费马小定理
2
求S(n) 题解:笨蛋小美的做法
3
求S(n) 题解:
4
求S(n) 题解:
5
求S(n) 题解:C
6
求S(n) (同余定理)题解:
7
求S(n) 题解:
8
求S(n) 题解:
9
求S(n) 题解:
10
求S(n) 题解:二项展开(3a+b)的5次幂对3的余=b的5次幂%3