本文主要是介绍C Ants GYM102501,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
签到
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <cmath>using namespace std;const int maxn = 1e6 + 7;map<string,int>mp;
int vis[maxn];int trans(string now) {int ans = 0;for(int i = 0;i < now.size();i++) {ans = ans * 10 + now[i] - '0';}return ans;
}int main() {ios::sync_with_stdio(false);int n;cin >> n;for(int i = 1;i <= n;i++) {string tmp;cin >> tmp;if(tmp[0] == '-') continue;if(tmp.size() > 7) continue;int now = trans(tmp);if(now > n + 1) continue;vis[now] = 1;}for(int i = 0;i <= n;i++) {if(!vis[i]) {cout << i << endl;return 0;}}return 0;
}
这篇关于C Ants GYM102501的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!