結果

問題 No.1558 Derby Live
コンテスト
ユーザー noya2
提出日時 2021-05-15 14:28:35
言語 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
結果
WA  
実行時間 -
コード長 1,490 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,348 ms
コンパイル使用メモリ 335,488 KB
実行使用メモリ 11,880 KB
最終ジャッジ日時 2026-06-20 10:39:07
合計ジャッジ時間 10,873 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/*
入力 validation。WA なら OK。
*/

#include"testlib.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

const int MIN_N = 2;
const int MAX_N = 18;
const int MIN_M = 2;
const int MAX_M = 10000;
const int MIN_Q = 2;
const int MAX_Q = 50000;


int main(){
	registerValidation();
	int N = inf.readInt(MIN_N, MAX_N, "N");
	inf.readSpace();
	int M = inf.readInt(MIN_M, MAX_M, "M");
	inf.readSpace();
	int Q = inf.readInt(MIN_Q, MAX_Q, "Q");
	inf.readEoln();
	int cnt = 0;
	bool testcase = false;
	for (int i = 0; i < Q; i++){
	    int t = inf.readInt(1, 3, "t");
	    inf.readSpace();
	    if (t == 1){
	        int B = inf.readInt(1, cnt+1, "B");
	        assert(B <= M);
	        if (B == cnt+1) cnt++;
	        inf.readSpace();
	        vector<int> v(N,0);
	        for (int j = 0; j < N; j++){
	            int p = inf.readInt(1,N,"p");
	            v[p-1]++;
	            if (j == N-1) inf.readEoln();
	            else inf.readSpace();
	        }
	        bool s = true;
	        for (int j = 0; j < N; j++) if (v[j] == 0) s = false;
	        assert(s);
	    }
	    else if (t == 2){
	        int S = inf.readInt(1, cnt, "S");
	        inf.readEoln();
	        testcase = true;
	    }
	    else if (t == 3){
	        int L = inf.readInt(1, cnt, "L");
	        inf.readSpace();
	        int R = inf.readInt(1, cnt, "R");
	        assert(L <= R && R <= M);
	        inf.readEoln();
	        testcase = true;
	    }
	}
	assert(testcase);
	inf.readEof();
	return 0;
}
0