ZJANS

f259. 皓宇的青蛙

Easy Last Update: 2026/01/12
cpp

# 題目簡述


解法一、Hash Set

✅ 完整代碼

評分結果(參考) : AC (0.6s, 47.2MB)

#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    string name;
    unordered_set<string> us;
    while(cin >> name){
        cout << us.count(name) << "\n";
        us.insert(name);
    }
    
    return 0;
}