首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
奶龙大王
2026年1月25日 14:49
求S(n) 题解:
P1500
回复 0
|
赞 1
|
浏览 76
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
|
赞 0
|
浏览 61
#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
|
赞 15
|
浏览 1.1k
#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
|
赞 5
|
浏览 857
#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);  ...
阿灿
2025年3月25日 10:12
求S(n) 题解:
P1500
回复 0
|
赞 8
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; int main(){ long long int n; while(cin>>n){ cout<<(n%3)*(n%3)*(n%3)%3<<endl; } return 0; }
西电机试专家
2025年2月11日 11:32
求S(n) 题解:笨蛋小美的做法
P1500
回复 0
|
赞 24
|
浏览 1.5k
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int ans=1; for(int i=0;i<5;i++){ &nbs...
可可爱爱草莓派
2024年9月1日 17:45
求S(n) 题解:
P1500
回复 0
|
赞 9
|
浏览 2.6k
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin >> n){ cout << (int(pow(n%3,5)) % 5) << endl; } }
hellokitty1679
2024年8月17日 23:21
求S(n) 题解:C
P1500
回复 0
|
赞 12
|
浏览 2.0k
#include<stdio.h> #include<math.h> int main(void) { int n,SN; while(scanf("%d",&n)!=EOF) {SN=pow((n%3),5); printf("%d\n",SN%3); } return 0; }
morning
2024年8月15日 21:34
求S(n) 题解:longlongint防止溢出
P1500
回复 0
|
赞 6
|
浏览 1.3k
#include <iostream> using namespace std; int main() { long long int n; while(cin>>n){ long long int s=n; for(int i=1;i<5;i++){ s=(s*n)%3; } s=s%3; &...
Candour
2024年4月29日 23:10
求S(n) (同余定理)题解:
P1500
回复 0
|
赞 7
|
浏览 1.4k
( a * b) % m = ((a % m) * (b % m)) % m #include <bits/stdc++.h> using namespace std; int n; int main() { while(cin >> n) { int res = n % 3; res = (res * res * res * res * res) % 3; cout << res << endl; } return 0; }
1
2
3
题目
求S(n)
题解数量
21
发布题解
在线答疑
热门题解
1
求S(n) 题解:笨蛋小美的做法
2
求S(n) 题解:费马小定理
3
求S(n) 题解:C
4
求S(n) 题解:
5
求S(n) 题解:
6
求S(n) (同余定理)题解:
7
求S(n) 题解:longlongint防止溢出
8
求S(n) 题解:C++实现
9
求S(n) 题解:C
10
求S(n) 题解:二项展开(3a+b)的5次幂对3的余=b的5次幂%3