PAT 甲级 1041 Be Unique

PAT 甲级 1041 Be Unique

#include <bits/stdc++.h>
using namespace std;
int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    vector<int> book(10010, 0);
    int n = 0;
    cin >> n;
    vector<int> bet(n);
    for (auto& i : bet) {
        cin >> i;
        book[i]++;
    }
    int i = 0;
    for (i = 0; i < n; ++i) {
        if (book[bet[i]] == 1) {
            cout << bet[i];
            break;
        }
    }
    if (i == n)
        cout << "None";
}
上一篇:Problem E. Bet


下一篇:模仿 "淘宝彩票" 的随机选球投注效果!