首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
Jinx_K
2026年3月10日 19:57
求S(n) 题解:10 line
P1500
回复 0
|
赞 0
|
浏览 33
#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
|
赞 14
|
浏览 209
/*是这么个逻辑 一个数%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
|
赞 8
|
浏览 234
#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
|
浏览 251
#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
|
赞 2
|
浏览 250
#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
|
浏览 232
#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
|
浏览 230
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...
曾不会
2026年1月25日 09:11
求S(n) 题解:
P1500
回复 0
|
赞 3
|
浏览 286
#include<stdio.h> int main() { int n; while(scanf("%d",&n)!=EOF) { int t=n%3; int s=t*t; s=s...
无名1
2025年6月23日 14:22
求S(n) 题解:费马小定理
P1500
回复 0
|
赞 26
|
浏览 1.3k
#include<bits/stdc++.h> using namespace std; int main(){ long long n; while(cin>>n){ cout<<n%3<<endl; } return 0; }
leo110
2025年5月14日 16:00
求S(n) 题解:二项展开(3a+b)的5次幂对3的余=b的5次幂%3
P1500
回复 0
|
赞 7
|
浏览 978
#include<iostream> #include<cmath> using namespace std; typedef long long ll; int main(){ ll n; while(cin>>n){ int a=n%3; a=pow(a,5);  ...
1
2
3
题目
求S(n)
题解数量
27
发布题解
在线答疑
热门题解
1
求S(n) 题解:笨蛋小美的做法
2
求S(n) 题解:费马小定理
3
求S(n) 题解:C
4
求S(n) 题解:
5
求S(n) (同余定理)题解:
6
求S(n) 题解:
7
求S(n) 题解:
8
求S(n) 题解:
9
求S(n) 题解:C
10
求S(n) 题解:二项展开(3a+b)的5次幂对3的余=b的5次幂%3