codeforces-Testing Round #10 -A. Forgotten Episode
来源:互联网 发布:微信小程序网站源码 编辑:程序博客网 时间:2024/06/07 13:34
这题意思就是说数的范围是1到n ,输入n-1个1到n范围内的数,最后看看1-n个树中那个没被输入,就把它输出就行
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int a[100000+5];
int main(){
int n,i;
scanf("%d",&n);
n--;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
sort(a,a+n);
for(i=0;i<=n;i++){
if(a[i]!=i+1){
printf("%d\n",i+1);break;
}
}
return 0;
}
0 0
- Codeforces Testing Round #10 A. Forgotten Episode
- codeforces-Testing Round #10 -A. Forgotten Episode
- CodeForces 440A Forgotten Episode
- A. Forgotten Episode(水题)
- CodeForces Testing Round #8 A.IQ Test
- Codeforces 597 A. Divisibility 【Testing Round #12】
- Codeforces Testing Round #14 (Unrated) A
- Codeforces Testing Round #10 C
- Codeforces Testing Round #10 B. Balancer
- Codeforces Testing Round #3
- Codeforces Testing Round #3
- Codeforces Testing Round #9
- 【Codeforces】Testing Round #12
- Codeforces Testing Round #8 / 328A IQ Test(模拟)
- Codeforces Testing Round #12 A. Divisibility( 容斥原理 )
- Codeforces Testing Round #14 (Unrated)
- Codeforces Testing Round #14 (Unrated)
- Codeforces Testing Round #14 (Unrated)
- 生活
- objectstatemanager 中已存在具有同一键的对象。objectstatemanager 无法跟踪具有相同键的多个对象。
- ListView的使用
- lvs FullNAT顿卡问题原因追查
- Eclipse中jsp、js文件编辑时,卡死现象解决汇总
- codeforces-Testing Round #10 -A. Forgotten Episode
- 静态邻接表
- MySQL数据库服务器端核心参数详解和推荐配置
- UVa 10394 - Twin Primes
- Android app远程控制相机开发过程障碍点
- 十个利用矩阵乘法解决的经典题目
- 函数指针按姓名,年龄,成绩对学生排序
- 第一个python,地址簿程序
- Asce's Summer Ranking No.7