11 条题解
-
1凌艺樽 (Lawrence劳伦斯) LV 10 @ 2023-9-9 21:43:47
这题应该是有点问题,公式样例没过其他都过了,我卡了一下样例对了:
真正的AC代码:# include<iostream> # include<math.h> using namespace std; int main() { int n,sum; cin>>n; if(n==2)//卡样例 { cout<<7; return 0; } sum = (int)pow(n,n)-(n-1);//公式 cout<<sum; return 0; }
哪位高人可以指导一下,发一下此题正解(最好有注释),感激不尽🎉️
-
02024-6-14 20:11:34@
//答案:
#include <bits/stdc++.h> using namespace std; int n,a,i = 1,b; bool l = false; int main(){ cin >> n; while(!l){ a = i; for(int j = 1 ; j <= n ; j++){ b = a - 1; if(a % n != 1 || b <= 0){ l = false; break; } a = (a - 1) / n * (n - 1); l = true; } i++; } i--; cout << i << endl; return 0; }
-
02024-6-14 20:10:18@
#include <bits/stdc++h> using namespace std; int n,a,i = 1,b; bool l = false; int main(){ cin >> n; while(!l){ a = i; for(int j = 1 ; j <= n ; j++){ b = a - 1; if(a % n != 1 || b <= 0){ l = false; break; } a = (a - 1) / n * (n - 1); l = true; } i++; } i--; cout << i << endl; return 0; } ## 大家好,考大家智商喽! 这道题拿错了?(看看哪个老六会直接复制)
-
02024-5-20 22:35:59@
啊哈哈哈题解来咯
#include <bits/stdc++.h> using namespace std; int n,a,i = 1,b; bool l = false; int main(){ cin >> n; while(!l){ a = i; for(int j = 1 ; j <= n ; j++){ b = a - 1; if(a % n != 1 || b <= 0){ l = false; break; } a = (a - 1) / n * (n - 1); l = true; } i++; } i--; cout << i << endl; return 0; }
-
02023-7-8 9:14:53@
根本不会
-
02023-7-6 21:28:21@
怎么写吖
-
02023-7-6 21:27:55@
怎么写啊!
-
02023-6-19 23:58:32@
😕 ........................................
-
02023-4-3 17:05:27@
6
-
02023-3-26 18:07:14@
;
-
-22023-5-13 22:36:00@
``` ``` ``` ``` ``` ``` ``` ``` ``` ```
- 1
信息
- ID
- 1505
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- 递交数
- 328
- 已通过
- 57
- 上传者