- 问答
【FAQ】问答&讨论贴
- 2024-8-29 16:06:46 @
不允许学生创建新讨论了,后面大家可以在这里讨论相关内容。会定期清理。
删了一些同学们自己举办的比赛的帖子。
我建议你们可以私聊参赛。讨论区太乱了,有些提问我看不到了已经。
更重要的是,还是先好好学算法吧各位同学,当你拿了提高组 分,再考虑自己举办一些简单的比赛。
语法场的初心还是为了学生们巩固基础语法,高水平选手可以选择参加入门语法场和入门提高场 目前也没看见能打的 (参考新春马拉松赛成绩)
感觉不过瘾还可以打atcoder和codeforces
448 条评论
-
李睿舟 TLE自动机 LV 10 (6050/14050) @ 2024-11-8 16:58:42
因为周赛命名变了,所以我猜33DIA会在将来又出一道输入场次说类型的题目
-
2024-11-8 13:20:58@
题目传送门https://oj.since2018.top/p/A0376
#include<iostream> using namespace std; int n,x,y; int main(){ cin>>n>>x>>y; int a=x*n; int b=y*n; if(a>b){ cout<<a-b; } else{ cout<<b-a; } return 0; } //zswdlqy
为什么只得30分?
-
2024-11-7 19:54:13@
求助,怎么改可以不CE
#include<bits/stdc++.h> using namespace std; int dis[100005]; struct node { int x; int w; }; bool operator <(const node &a,const node &b) { return dis[a.x]<dis[b.x]; } int n,m,s; vector<node> e[100005]; priority_queue<int,vector<int>,greater<node>> q; void dijkstra(int s) { q.push(s); dis[s]=0; while(!q.empty()) { int u=q.top(); q.pop(); for(int i=0;i<e[u].size();i++) { node v=e[u][i]; if(dis[v.x]>dis[u]+v.w) { dis[v.x]=dis[u]+v.w; q.push(v.x); } } } } int main() { ios::sync_with_stdio(0); cin.tie(0); memset(dis,0x3f3f3f3f3f3f,sizeof(dis)); cin>>n>>m>>s; for(int i=1;i<=m;i++) { int u,v,w; cin>>u>>v>>w; e[u].push_back({v,w}); } dijkstra(s); for(int i=1;i<=n;i++) { if(dis[i]==0x3f3f3f3f) { cout<<(1<<31)-1<<' '; } else { cout<<dis[i]<<' '; } } return 0; }
-
2024-11-6 20:18:12@
求助
下图是一个程序
#include <bits/stdc++.h> using namespace std; int n,p[20]; void dfs(int m,int c){ for(int i=m;i<=c;i++){ cout<<p[i]<<" "; } cout<<endl; if(c<n){ dfs(m,c+1,d+1); } else{ return; } } int main(){ cin>>n; for(int i=1;i<=n;i++){ p[i]=i; } for(int i=1;i<=n;i++){ dfs(i,1,0); } return 0; }
谁能帮我把输出时多出的空行去掉?QAQ
QQL
求求啦!!!
-
2024-11-5 19:37:11@
祝大家明天考试取得好成绩
-
2024-11-5 14:47:00@
我在学校机房里刷题 ahh!!!
-
2024-11-5 11:38:25@
为什么语法周赛改成挖土机周赛了
-
2024-11-4 19:11:09@
我飞了
-
2024-11-3 18:10:21@
//考试必备 #include<bits/stdc++.h> using namespace std; int main(){ freopen(".in","r",stdin); freopen(".out","w",stdout); return 0; }
-
2024-11-2 15:37:20@
6
-
2024-11-2 13:33:24@
https://oj.since2018.top/p/TEST1001 真是一道普普通通的题
-
2024-11-1 22:57:51@
论 CSP_J时 T2 我旁边 有一个 char a[10000][10000] 的 (char 1亿) 我还认识
-
2024-11-1 19:37:43@
我发现了什么??? 此
-
2024-10-30 20:02:24@
#include<bits/stdc++.h> using namespace std; int main(){ string a; cin>>a; if(a[0]=='A'){ if(a[1]=='p'){ cout<<"January"; } else{ cout<<"February"; } } if(a[0]=='D'){ cout<<"March"; } if(a[0]=='F'){ cout<<"April"; } if(a[0]=='J'){ if(a[1]=='a'){ cout<<"May"; } else if(a[2]=='l'){ cout<<"June"; } else{ cout<<"July"; } } if(a[0]=='M'){ if(a[2]=='r'){ cout<<"August"; } else{ cout<<"September"; } } if(a[0]=='N'){ cout<<"October"; } if(a[0]=='O'){ cout<<"November"; } if(a[0]=='S'){ cout<<"December"; } }
为啥RE? https://oj.since2018.top/p/A0588
-
2024-10-30 16:35:13@
-
2024-10-29 22:56:10@
什么时候加一言
-
2024-10-28 20:22:38@
#include <bits/stdc++.h> using namespace std; string a; int c=0; int main() { cin >> a; for(int i=1;i<=a.size();i++) { if(a[i]=='0'||a[i]=='1'||a[i]=='2'||a[i]=='3'||a[i]=='4'||a[i]=='5'||a[i]=='6'||a[i]=='7'||a[i]=='8'||a[i]=='9') { c++; } } cout << c; } //为啥输出0!!!
-
2024-10-27 23:39:32@
-
2024-10-27 10:38:51@
-
2024-10-27 0:21:55@
洛谷测分120
(OS:我是不是完了)
100 0 20 0
-
2024-10-26 21:50:55@
set不是可以去重吗,为何不用?
-
2024-10-26 21:50:16@
#include<bits/stdc++.h> using namespace std; int main(){ set<string> se; int n; cin>>n; for(int i=0;i<n;i++){ string s; cin>>s; se.insert(s); } cout<<52-(int)se.size(); return 0; }
-
2024-10-26 21:49:15@
第一题谁都会
-
2024-10-26 21:40:59@
超级马里奥
题解#include<stdio.h> int main() { pinf( " ********\n" " ************\n" " ####....#.\n" " #..###.....##....\n" " ###.......###### ### ###\n" " ........... #...# #...#\n" " ##*####### #.#.# #.#.#\n" " ####*******###### #.#.# #.#.#\n" " ...#***.****.*###.... #...# #...#\n" " ....**********##..... ### ###\n" " ....**** *****....\n" " #### ####\n" " ###### ######\n" "##############################################################\n" "#...#......#.##...#......#.##...#......#.##------------------#\n" "###########################################------------------#\n" "#..#....#....##..#....#....##..#....#....#####################\n" "########################################## #----------#\n" "#.....#......##.....#......##.....#......# #----------#\n" "########################################## #----------#\n" "#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n" "########################################## ############\n" ); return 0; } //zswdlqy //放抄袭 //懂得都懂 //提示printf
-
2024-10-26 21:28:36@
using namespace std; int main(){ int n; char a[53][3]; cin>>n; int c=52-n; for(int i=1;i<=n;i++){ cin>>a[i][1]>>a[i][2]; } for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ if(a[i][1]==a[j][1] && a[i][2]==a[j][2] && (a[i][1]!='0'|| a[j][1]!='0')){ c++; a[j][1]='0'; a[j][2]='0'; } } } cout<<c; } //由于太简单,直接被过了好吧 //第一题稳拿AC //zswdlqy
-
2024-10-26 18:07:48@
搞笑的事情
-std=c++14 -O2 -Wl,--stack=1073741824
考试时要求:
考生答案中主函数栈的大小不可超过题目限制大小 (4道题都是512MiB,但上方的栈设定高达1GiB,使用可能会炸,还有可能会爆0)
-
2024-10-25 19:12:48@
👀👀
-
2024-10-25 18:23:44@
A0454 30 AC9 WA1 就错一个数据点哈哈哈
#include <bits/stdc++.h> using namespace std; int main(){ string a; cin>>a; if(a[1]==a[3] && a[3]==a[5] && a[5]==a[1] && a[0]!=a[1] && a[1]!=a[2] && a[2]!=a[4] && a[4]!=a[0]){ cout<<"Yes"; } else{ cout<<"No"; } return 0; }
-
2024-10-25 11:53:23@
我
严重觉得挖毒机挖土机OJ比没有洛谷好 -
2024-10-24 20:19:45@
炒鸡马力有戏题解 为了防止某些萌新红温
```cpp #include<cstdio> using namespace std; int main() { printf(" ********\n"); printf(" ************\n"); printf(" ####....#.\n"); printf(" #..###.....##....\n"); printf(" ###.......###### ### ###\n"); printf(" ........... #...# #...#\n"); printf(" ##*####### #.#.# #.#.#\n"); printf(" ####*******###### #.#.# #.#.#\n"); printf(" ...#***.****.*###.... #...# #...#\n"); printf(" ....**********##..... ### ###\n"); printf(" ....**** *****....\n"); printf(" #### ####\n"); printf(" ###### ######\n"); printf("##############################################################\n"); printf("#...#......#.##...#......#.##...#......#.##------------------#\n"); printf("###########################################------------------#\n"); printf("#..#....#....##..#....#....##..#....#....#####################\n"); printf("########################################## #----------#\n"); printf("#.....#......##.....#......##.....#......# #----------#\n"); printf("########################################## #----------#\n"); printf("#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n"); printf("########################################## ############\n"); return 0; } //ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็ ด้้้้้็้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้้้้้็็็็็้้้้้้็็็็็้
能过
#include <bits/stdc++.h> using namespace std; int main(){ cout<<" ******** "<<endl; cout<<" ************"<<endl; cout<<" ####....#."<<endl; cout<<" #..###.....##...."<<endl; cout<<" ###.......###### ### ###"<<endl; cout<<" ........... #...# #...#"<<endl; cout<<" ##*####### #.#.# #.#.#"<<endl; cout<<" ####*******###### #.#.# #.#.#"<<endl; cout<<" ...#***.****.*###.... #...# #...#"<<endl; cout<<" ....**********##..... ### ###"<<endl; cout<<" ....**** *****...."<<endl; cout<<" #### ####"<<endl; cout<<" ###### ######"<<endl; cout<<"##############################################################"<<endl; cout<<"#...#......#.##...#......#.##...#......#.##------------------#"<<endl; cout<<"###########################################------------------#"<<endl; cout<<"#..#....#....##..#....#....##..#....#....#####################"<<endl; cout<<"########################################## #----------#"<<endl; cout<<"#.....#......##.....#......##.....#......# #----------#"<<endl; cout<<"########################################## #----------#"<<endl; cout<<"#.#..#....#..##.#..#....#..##.#..#....#..# #----------#"<<endl; cout<<"########################################## ############"<<endl; }
必过
-
2024-10-24 8:58:05@
关于炒鸡马力有戏
PHP是最简单的(前几天无意在另一道题的题解里看到的) 直接ctrl+c,ctrl+v PHP会输出所有不是代码不是注释的玩意
-
2024-10-23 23:41:16@
-
2024-10-23 23:14:13@
四倍经验!
P1020
P1158
A0516
P2487
-
2024-10-23 22:48:42@
连环计33DAI是不是卡dfs做法了,还是我的dfs写错了
只得了30分QAQ
#include<bits/stdc++.h> using namespace std; int n; int a[105][105]; int vis[105][105],cnt,ans=0; void dfs(int x,int y) { if(x<1 || x>n || y<1 || y>n || vis[x][y]) { return; } //cout<<x<<' '<<y<<'\n'; vis[x][y]=1; cnt++; int s=a[x][y]; for(int i=0;i<=s;i++) { dfs(x+s,y+i); dfs(x+s,y-i); dfs(x-s,y+i); dfs(x-s,y-i); dfs(x+i,y+s); dfs(x-i,y+s); dfs(x+i,y-s); dfs(x+-i,y-s); } } int main() { freopen("lian.in","r",stdin); freopen("lian.out","w",stdout); cin>>n; for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { cin>>a[i][j]; } } for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { // if(a[i][j]==0) // { // continue; // } memset(vis,0,sizeof(vis)); cnt=0; dfs(i,j); ans=max(ans,cnt); } } cout<<ans; return 0; }
-
2024-10-23 22:19:50@
33DAI今天没有更新比赛归档qwq
-
2024-10-23 21:01:49@
大家都在写水题题解,来个还行的
首先是01悲煲
for(int i=1;i<=n;i++){ for(int j=m;j>=w[i];j--){ dp[j]=max(dp[j],dp[j-w[i]]+w[i]);//选不选 } } dp[m]是答案
切题
有模板A0517 写另一道A0526 双经(P1049)
#include<bits/stdc++.h> using namespace std; //体积? //剩余空间最小=拿的东西体积总和最大 //以前的问题:价值最大 //转化01悲煲 //说明价值=体积 //哪体积呢? //仍是体积? //写下试试 //2分钟... //WA! //50 //好家伙,01悲煲写错了 //AC int m,n,w[35],dp[20005]; int main(){ cin>>m>>n; for(int i=1;i<=n;i++){ cin>>w[i]; } for(int i=1;i<=n;i++){ for(int j=m;j>=w[i];j--){ dp[j]=max(dp[j],dp[j-w[i]]+w[i]); } } cout<<m-dp[m]; return 0; }
-
2024-10-23 20:20:58@
-
2024-10-23 20:07:50@</p>
C C F 让 我们 A K C S P - j 吧
-
2024-10-23 19:14:40@
题解CSP2022J2C
//就不写#include<bits/stdc++.h> //前方高能 #include<iostream> #include<vector> #include<cmath> #include<cstring> #include<algorithm> #include<list> #include<map> #include<queue> #include<stack> #include<iterator> #include<bitset> #include<cctype> #include<cerrno> #include<clocale> #include<complex> #include<cstdio> #include<cstdlib> #include<ctime> #include<deque> #include<exception> #include<fstream> #include<functional> #include<limits> #include<iomanip> #include<ios> #include<iosfwd> #include<istream> #include<ostream> #include<set> #include<sstream> #include<stdexcept> #include<streambuf> #include<utility> #include<cwchar> #include<cwctype> using namespace std; string s; int z,ans1,ans0,f; int main(){ freopen("expr.in","r",stdin); freopen("expr.out","w",stdout); cin>>s; for(int i=0;i<s.size();i++){ if(!f){ if(s[i]=='1')z=1; if(s[i]=='0') z=0; if(s[i]=='&'&&!z){ //就不写ans1++ ++ans1; f=1; } if(s[i]=='|'&&z){ //就不写ans0++ ++ans0; f=2; } }else{ if(s[i]=='('){ int x=1; while(x>0){ //就不写i++ ++i; if(s[i]=='('){ //就不写x++ ++x; } if(s[i]==')'){ //就不写x-- --x; } } }else if(f==1&&s[i]=='|')f=0; else if(s[i]==')')f=0; else if(f==1&&s[i]=='&'){ //就不写ans1++ ++ans1; }else if(f==2&&s[i]=='|'){ //就不写ans0++ ++ans0; } } } //就不写endl cout<<z<<'\n'; //就不写" " cout<<ans1<<' '<<ans0; }
-
2024-10-23 15:47:32@
今天来炸波简单题
(MC++老课堂-1)
今日简单题目: 第十四场周赛-T2——喜欢除法的 TooY0ung
俗话说的不好,做题先读题
读完题后,我们发现这道题的数据有骗分点(LXTYNO.1*)
*:良心TooY0ung×1
粘贴一下
子任务 1(30 分):保证 。
这证明什么?
我们只需要输出第二个数 mod 2 的余数即可
(30分就这么简单)
下发奏折(代码):
#include <bits/stdc++.h> using namespace std; int n,a[1000005]; int main(){ cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; cout<<a[2]%2; return 0; }
MC++LXNO.1*来啦↑
*:MC++良心×1
接下来分析如何满分:
既然我们可以用a[2]%2,那么我们就可以用a[i]%i(1-n)来直接求出答案
这次不给代码嘻嘻
如果你的代码是60分,那就对了
错误原因:
#3-1 Wrong Answer 读取到 -1541162594,应为 226092104094。
#3-2 Wrong Answer 读取到 -1632107047,应为 226001159641。
原因很明显,应为的这两个数超int了
(十年OI一场空,不开LL见祖宗)
只需改LL,AC冲过来!!!
YXJS
-
2024-10-23 9:18:38@
老师,P4799翻译错了吧,
all of which can be spent on tickets. 题目中翻译:他决定把所有财产都用来买门票 可是all of是所有,which指他手里的马内,can是可以,spent on tickets是花在门票上, 意思就是所有马内都可以花在看比赛
-
2024-10-23 1:29:41@
-
2024-10-22 23:22:10@
好题P9389
-
2024-10-22 22:50:21@
@33DAI,网站自定义徽章可以叠加吗???
-
2024-10-22 22:40:32@
-
2024-10-22 22:33:25@
#include <bits/stdc++.h> #define int long long using namespace std; const int inf = 1'000'000'000'000'000'000; int n,k; int a[5]; int lcm12,lcm23,lcm13,lcm123; int gcd(int a, int b){ if (!b){ return a; } return gcd(b, a % b); } int lcm(int a, int b){ return a / gcd(a, b) * b; } bool check(int mid){ int cnt = 0; if (n == 1){ cnt += mid / a[1]; } else if (n == 2){ cnt += mid / a[1]; cnt += mid / a[2]; cnt -= 2 * (mid / lcm12); } else{ cnt += mid / a[1]; cnt += mid / a[2]; cnt += mid / a[3]; cnt -= 2 * (mid / lcm12); cnt -= 2 * (mid / lcm23); cnt -= 2 * (mid / lcm13); cnt -= 3 * (mid / lcm123); } return cnt >= k; } signed main(){ freopen("mei.in", "r", stdin); freopen("mei.out", "w", stdout); cin >> n >> k; for (int i = 1; i <= n; i++){ cin >> a[i]; } if (n == 2){ lcm12 = lcm(a[1], a[2]); } else if (n == 3){ lcm12 = lcm(a[1], a[2]); lcm23 = lcm(a[2], a[3]); lcm13 = lcm(a[1], a[3]); lcm123 = lcm(lcm12, lcm23); } int l = 1; int r = inf; int ans = -1; while (l <= r){ int mid = (l + r) / 2; if (check(mid)){ ans = mid; r = mid - 1; } else{ l = mid + 1; } } cout << ans; return 0; }
只得了60分,有没有人来看看
-
2024-10-22 20:40:35@