提出 #76762975


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    int cnt;
    int mx;
    bool x = true;
    cin >> N;
    string A[100005];
    int T[1000005];
    for(int i = 0; i < N; i ++) cin >> A[i] >> T[i];

    set<string> seen;

    mx = T[0];
    cnt = 1;

    for(int i = 0; i < N; i++) {

        if(seen.count(A[i])) {
            continue; // 既出
        }

        seen.insert(A[i]); // 初登場

        if(T[i] > mx) {
            mx = T[i];
            cnt = i + 1; // 1-indexed
        }
    }
    cout << cnt << endl;
}

提出情報

提出日時
問題 E - Poem Online Judge
ユーザ Kisaragi2000
言語 C++23 (GCC 15.2.0)
得点 300
コード長 586 Byte
結果 AC
実行時間 93 ms
メモリ 18376 KiB

コンパイルエラー

./Main.cpp: In function 'int main()':
./Main.cpp:8:10: warning: unused variable 'x' [-Wunused-variable]
    8 |     bool x = true;
      |          ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 13
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 02_sorted_00.txt, 02_sorted_01.txt, 03_corner_00.txt, 03_corner_01.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 4 ms 10488 KiB
00_sample_01.txt AC 4 ms 10444 KiB
00_sample_02.txt AC 3 ms 10420 KiB
01_random_00.txt AC 27 ms 10492 KiB
01_random_01.txt AC 31 ms 10492 KiB
01_random_02.txt AC 35 ms 10568 KiB
01_random_03.txt AC 39 ms 10588 KiB
01_random_04.txt AC 92 ms 18304 KiB
01_random_05.txt AC 93 ms 18176 KiB
02_sorted_00.txt AC 92 ms 18344 KiB
02_sorted_01.txt AC 92 ms 18376 KiB
03_corner_00.txt AC 43 ms 10368 KiB
03_corner_01.txt AC 50 ms 11128 KiB