CodeForces-137B Permutation
来源:互联网 发布:珠宝软件有哪些 编辑:程序博客网 时间:2024/04/27 14:57
#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int n_max = 5000 + 5;int n, ans;int sign[n_max];int num[n_max];int main(){ while(~scanf("%d", & n)) { for(int i = 0; i < n; i ++) scanf("%d", & num[i]); memset(sign, 0, sizeof(sign)); for(int i = 0; i < n; i ++) sign[num[i]] = 1; int sum = 0; for(int i = 1; i <= n; i ++) sum += sign[i]; ans = n - sum; printf("%d\n", ans); } return 0;}
题目:
第一行输入n,之后底下有n个数。这些数中间少了1~n中的几个数。
题解:
水
0 0
- CodeForces-137B Permutation
- Codeforces-137B-Permutation
- codeforces B. Permutation
- Codeforces 359B Permutation
- CodeForces 56B Spoilt Permutation
- CodeForces 359B - Permutation(思维)
- Codeforces 818B Permutation Game
- codeforces 359B B. Permutation(简单构造)
- codeforces B. Restoration of the Permutation
- Codeforces Round #209 (Div. 2) B. Permutation
- Codeforces —— 359B Permutation
- Codeforces 500B - New Year Permutation (思维)
- codeforces #500B# New Year Permutation
- Permutation CodeForces 359B
- Codeforces 553B Kyoya and Permutation
- Codeforces 553B Kyoya and Permutation
- Codeforces 553 B. Kyoya and Permutation
- Codeforces 618B Guess the Permutation
- php页面跳转的几种方法
- ubuntu不常用命令集中贴(不定期更新~~~)
- Android Preference技巧 持久化
- Spark修炼之道(进阶篇)——Spark入门到精通:第一节 Spark 1.5.0集群搭建
- hive使用tez的时候tez的配置
- CodeForces-137B Permutation
- hp实训之Java(第四周)
- Autolayout 希伯来语左右颠倒问题
- Testlink提高篇
- Linux 学习_在Linux下面安装eclipse
- 要成为一名WEB开发高手,必须熟练了解的内容
- Ldap的概念和原理
- synchronized 理解
- MD5