首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
太一
2026年3月16日 17:45
求S(n) 题解:
P1500
回复 0
|
赞 7
|
浏览 165
#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
|
赞 2
|
浏览 151
//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
|
赞 2
|
浏览 98
#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
|
浏览 157
#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
|
赞 24
|
浏览 366
/*是这么个逻辑 一个数%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
|
赞 9
|
浏览 288
#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
|
浏览 301
#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
|
浏览 311
#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
|
赞 2
|
浏览 286
#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 >> ...
奶龙大王
2026年1月25日 14:49
求S(n) 题解:
P1500
回复 0
|
赞 3
|
浏览 278
FMOD与POW函数 #include <iostream> #include <cmath> // 必须包含 cmath using namespace std; int main() { long long n; while(cin>>n){ n=n%3; double temp=fmod(pow(n,5...
1
2
3
题目
求S(n)
题解数量
30
发布题解
在线答疑
热门题解
1
求S(n) 题解:费马小定理
2
求S(n) 题解:笨蛋小美的做法
3
求S(n) 题解:
4
求S(n) 题解:C
5
求S(n) (同余定理)题解:
6
求S(n) 题解:
7
求S(n) 题解:
8
求S(n) 题解:
9
求S(n) 题解:C
10
求S(n) 题解: