結果

問題 No.938 賢人を探せ
ユーザー RubikunRubikun
提出日時 2019-12-01 00:02:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 633 bytes
コンパイル時間 1,796 ms
コンパイル使用メモリ 176,124 KB
実行使用メモリ 7,396 KB
最終ジャッジ日時 2023-08-21 03:23:57
合計ジャッジ時間 3,238 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
7,396 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 18 ms
6,456 KB
testcase_09 AC 18 ms
6,480 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 23 ms
6,436 KB
testcase_12 AC 19 ms
5,380 KB
testcase_13 AC 19 ms
5,380 KB
testcase_14 AC 19 ms
5,480 KB
testcase_15 AC 20 ms
5,424 KB
testcase_16 AC 19 ms
5,400 KB
testcase_17 AC 20 ms
5,400 KB
testcase_18 AC 19 ms
5,376 KB
testcase_19 AC 20 ms
5,400 KB
testcase_20 AC 19 ms
5,360 KB
testcase_21 AC 20 ms
5,376 KB
testcase_22 AC 55 ms
7,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;cin>>N;
    vector<string> A;
    map<string,int> MA;
    for(int i=0;i<N;i++){
        string S,T;cin>>S>>T;
        A.push_back(S);
        A.push_back(T);
        MA[S]++;
    }
    
    for(int i=0;i<A.size();i++){
        string S=A[i];
        if(MA[S]==0){
            cout<<S<<endl;
            MA[S]=-1;
        }
    }
}


0