竞赛
考级
我的主页(点击进入)
题目描述 将给出的n个正整数从小到大排好序后去重输出,数字的大小一定小于10000 。 去重输出:如果数组里有多个数x,只需要输出1次x即可。 提示:要好好利用数字范围这个特性。 输入格式 第一行包含正整数n,表示数字个数。 第二行包含n个待排序的数字,用空格隔开。 输出格式 按顺序输出去重后的每一个数字,数字间不需要空格隔开。
#include<bits/stdc++.h> using namespace std; int main(){ long long a,b[10],c=0,mx=0; for(int i=1;i<=5;i++){ scanf("%d",&b[i]); } mx=b[1]; for(int i=1;i<=5;i++){ if(b[i]>=mx){ mx=b[i]; } } printf("%d",mx); return 0; }
我在CLion上测的都对的,但是时间超时了2ms,他就显示我错了
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c=0;#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c=0; cin>>a>>b; for(int i=a;i<=b;i++){ for(int j=2;j<=b-1;j++){ if(a%j0 and b%j0){ c++; } } } cout<<c; return 0; } }
#include<bits/stdc++.h> using namespace std; int main(){ int n,s=0,i; scanf("%d",&n); while(n>1){ if(n%20){ i=n/2; printf("%d/2=%d\n",n,i); n=i; } else{ i=n3+1; printf("%d3+1=%d\n",n,i); n=i; } } if(n1){ printf("End"); } return 0; }
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; scanf("%d",&a); b=a%10; c=a/10%10; d=a/100%10; e=a/1000%10; f=a/10000%10; printf("%d%d%d%d%d",b,c,d,e,f); return 0; }
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,d,e,c=1,f=1; scanf("%d %d",&a,&b); scanf("%d %d",&d,&e); while(c!=0){ c=a%b; a=b; b=c; } while(f!=0){ f=d%e; d=e; e=f; } printf("%d\n%d",a,d); return 0; }
我和“有兽焉”的小伙伴都在ACGO等你,快用这个专属链接加入我们吧!https://www.acgo.cn/application/1752624769180352512
我和“C++”的小伙伴都在ACGO等你,快用这个专属链接加入我们吧!https://www.acgo.cn/application/1738517918450237440
比赛已结束! ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 赛时说明 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1.第4题#7有误,现将#7的数据公开,以便AK比赛 万分抱歉! AK ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ * 最后提交时间:13:12:39 用户警告 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 以下用户有作弊嫌疑,同时如对结果有异议请联系lan_chance: ID:31****1 疑似抄袭AI生成的代码,已将其踢出排名,现通报! 请其它选手杜绝抄袭行为! 如对比赛有疑问,可以在此帖底下回复 比赛链接 邀请码: XEJ2 前五!(最终排名): ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 排名 ID 得分 参赛者 是否有作弊嫌疑 1 929871 450 Macw07 / 2 4010083 440 坤坤 已扣除10分 T7 3 4039641 320 寤攗鮗囿瓊 / 4 2369314 232 廾匸 / 5 3561366 221 准 / ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 附:疑似抄袭代码( ID:31****1 )
新春欢乐赛的手速奖一共就十个吗?如果一个人拿了两个不发,会给第二名发吗?
太垃了
题目: 我的代码: 全TLE了,肯定因为循环太多次,求在只学到循环嵌套的条件下优化
啊?一会wc一会ac
共33394条