結果

問題 No.938 賢人を探せ
ユーザー tarattata1tarattata1
提出日時 2019-12-01 01:29:55
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 1,257 bytes
コンパイル時間 713 ms
コンパイル使用メモリ 84,880 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2023-08-21 03:28:00
合計ジャッジ時間 2,051 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
7,844 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 17 ms
5,296 KB
testcase_09 AC 19 ms
5,288 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 23 ms
5,284 KB
testcase_12 AC 18 ms
5,268 KB
testcase_13 AC 18 ms
5,292 KB
testcase_14 AC 18 ms
5,336 KB
testcase_15 AC 18 ms
5,268 KB
testcase_16 AC 18 ms
5,360 KB
testcase_17 AC 18 ms
5,324 KB
testcase_18 AC 18 ms
5,348 KB
testcase_19 AC 18 ms
5,284 KB
testcase_20 AC 18 ms
5,384 KB
testcase_21 AC 18 ms
5,376 KB
testcase_22 AC 30 ms
7,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;
using namespace std;


int main(int argc, char* argv[])
{
    int n;
    scanf("%d", &n);
    vector<pair<string,int> > z;
    int cnt=0;
    map<string,int> mp;
    int i;
    for(i=0; i<n*2; i++) {
        char str0[11]={0};
        scanf("%s", str0);

        auto it=mp.find(string(str0));
        if(it==mp.end()) {
            int tmp=(i%2==0? 1: 0);
            z.push_back(make_pair(string(str0),tmp));
            mp.insert(make_pair(string(str0), cnt));
            cnt++;
        }
        else {
            int tmp=(i%2==0? 1: 0);
            z[it->second].second+=tmp;
        }
    }

    for(i=0; i<(int)z.size(); i++) {
        if(z[i].second==0) {
            printf("%s\n", z[i].first.c_str());
        }
    }


    return 0;
}
0