/* 入力 validation。WA なら OK。 */ #include "testlib.h" #include using namespace std; int main(){ registerValidation(); const long long maxll = 1'000'000'000'000'000'000; const int maxint = 1'000'000'000; const int maxn = 18; const int minn = 2; const int maxm = 10000; const int minm = 2; const int maxq = 50000; const int minq = 2; int n = inf.readInt(minn,maxn,"n"); inf.readSpace(); int m = inf.readInt(minm,maxm,"m"); inf.readSpace(); int q = inf.readInt(minq,maxq,"q"); inf.readEoln(); vector ok(m,0); ok[0] = 1; for (int i = 0; i < q; i++){ int t = inf.readInt(1,3,"t"); inf.readSpace(); if (t == 1){ int d = inf.readInt(1,m,"d"); inf.readSpace(); vector cnt(n,0); for (int j = 0; j < n; j++){ int p = inf.readInt(1,n,"p"); cnt[p-1]++; if (j != n-1) inf.readSpace(); else inf.readEoln(); } bool t = true; for (int j = 0; j < n; j++){ if (cnt[j] != 1) t = false; } assert(t); assert(ok[d-1] > 0); ok[d]++; } else if (t == 2){ int s = inf.readInt(1,m,"s"); inf.readEoln(); assert(ok[s] > 0); } else if (t == 3){ int l = inf.readInt(1,m,"l"); inf.readSpace(); int r = inf.readInt(l,m,"r"); inf.readEoln(); assert(ok[r] > 0); } } inf.readEof(); return 0; }