結果

問題 No.2372 既視感
コンテスト
ユーザー primenumber11
提出日時 2023-06-17 14:40:11
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.90.0)
コンパイル:
g++-12 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 1,171 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,879 ms
コンパイル使用メモリ 335,828 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-07-01 08:26:23
合計ジャッジ時間 7,000 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// by poyon and altered by rintaro 
#include "testlib.h"

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

int main() {
    registerValidation();

    int N = inf.readInt(1, 500);
    inf.readSpace();
    int K = inf.readInt(1, 100);
    inf.readSpace();
    int Q = inf.readInt(1, 500);
    inf.readChar('\n');

    auto check_string = [&](string S) -> void {
        int n = (int)S.size();
        ensure(1 <= n && n <= 10);
        for (auto c : S) { ensure(islower(c)); }
    };
    int failed=0;

    for (int i = 0; i < Q; i++) {
        int q = inf.readInt(1, 2);
        if (q == 1) {
            inf.readSpace();
            string s = inf.readToken();
            check_string(s);
        } else {
            set<string> st;
            for (int j = 0; j < 6; j++) {
                inf.readSpace();
                string t = inf.readToken();
                inf.readSpace();
                int d = inf.readInt(1, 100);

                if(st.count(t) == 1){cout<<i<<endl;failed=1;}
                check_string(t);

                st.insert(t);
            }
        }
        inf.readChar('\n');
    }

    inf.readEof();
    assert(failed);
    return 0;
}
0