- 五位数倒序组合判断质数
存代码的
- @ 2026-3-31 16:20:08
1
7 条评论
-
马铭泽 @ 2026-4-21 15:58:48'1': D '2': A '3': D '4': C '5': B '6': A '7': D '8': C '9': A '10': B '11': D '12': A '13': D '14': C '15': B '16': B '17': B '18': A '19': A '20': A '21': A '22': B '23': A '24': A '25': B '26': A '27': B '28': A '29': A '30': A '31': D '32': C '33': D '34': C '35': A '36': B '37': B '38': A '39': A '40': D '41': A '42': C
-
@ 2026-4-12 14:56:14#include<bits/stdc++.h> using namespace std; int a[25],b[25]; int main(){ int x,y,z; cin >> x >> y >> z; for(int i = 1;i <= x;i++){ cin >> a[i]; } int maxn = 0; for(int i = 1;i <= y;i++){ int n,cnt = 0; cin >> n; if(b[n] == 0){ b[n] = 1; cnt += a[n]; //cout << cnt << " "; if(maxn < cnt){ maxn = cnt; cout << maxn << " "; } if(cnt > z){ cout << "Oh, My God!"; return 0; } } else{ b[n] = 0; cnt -= a[n]; } } cout << maxn; return 0; }西湖
-
@ 2026-4-5 12:58:00。
-
@ 2026-4-1 15:54:36(还没敲完,
刚写了恶搞你的开头...) -
@ 2026-4-1 15:53:51小游戏
#include <bits/stdc++.h> #include <windows.h> #include <time.h> using namespace std; signed main(){ cout<<"欢迎来到??世界"<<endl<<"请输入您在游戏中的名称:"; system("color Cf"); string a; cin>>a; cout<<endl; cout<<"正在加载中,请稍后..."<<endl; cout<<"%10 ▏"<<endl; Sleep(500); cout<<"%20 ▏▎"<<endl; Sleep(500); cout<<"%30 ▏▎▍"<<endl; Sleep(500); cout<<"%40 ▏▎▍▌"<<endl; Sleep(500); cout<<"%50 ▏▎▍▌▋"<<endl; Sleep(500); cout<<"%90 ▏▎▍▌▋▊▉"<<endl; Sleep(500); cout<<"正在进入中..."<<endl; Sleep(2500); cout<<"进入成功!"<<endl; Sleep(600); cout<<"△▽○◇□☆▲▼●◆■★"<<endl; cout<<"游戏名:我闲的?!"<<endl; cout<<"作者:柳"<<endl; cout<<"您好!!\n~~你给我查看规则,否则根本不会玩~~"<<endl; cout<<"规则:\n↖ ↑ ↗\n← ? →\n↙ ↓ ↘\n"; cout<<"您好,尊贵的"<<a<<"用户,已为您新建世界\n"; cout<<"加载地形中...\n"; cout<<"%10 ▏"<<endl; Sleep(500); cout<<"%20 ▏▎"<<endl; Sleep(500); cout<<"%30 ▏▎▍"<<endl; Sleep(500); cout<<"%40 ▏▎▍▌"<<endl; Sleep(500); cout<<"%50 ▏▎▍▌▋"<<endl; Sleep(500); cout<<"%90 ▏▎▍▌▋▊▉"<<endl; Sleep(1500); cout<<"进入成功!\n"; cout<<"规则:\n"; cout<<" 我建议你晚上不要出了你的家~~~\n"; return 0; } -
@ 2026-3-31 16:21:16#include<bits/stdc++.h> using namespace std; vector<int> a; int main(){ int n; cin >> n; int b = n; a.push_back(0); while(n--){ int x; cin >> x; a.push_back(x); } int cnt = 0; for(int i = 1;i <= b;i++){ int x = a[i],d = 0; for(int j = i+1;j <= b;j++){ if(x > a[j]){ x = a[j]; d = j; } } int y = d,l = i; if(y < l) swap(y,l); cnt += y - l; swap(a[i],a[x]); } cout << cnt; return 0; }新的
-
@ 2026-3-31 16:20:31#include<bits/stdc++.h> using namespace std; vector<int> a; int main(){ int n; cin >> n; int b = n; while(n--){ int x; cin >> x; a.push_back(x); } int cnt = 0; for(int i = 0;i < b;i++) for(int j = i+1;j < b;j++){ if(a[i]> a[j]){ cnt += j - i; swap(a[i],a[j]); } } cout << cnt; return 0; }旧的
- 1
信息
- ID
- 940
- 时间
- ms
- 内存
- MiB
- 难度
- 8
- 标签
- 递交数
- 135
- 已通过
- 25
- 上传者