QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#504436 | #9155. 集合 | synonym | 100 ✓ | 824ms | 14508kb | C++14 | 787b | 2024-08-04 12:56:58 | 2024-08-04 12:56:58 |
Judging History
answer
#include <bits/stdc++.h>
#define F(a,b)for(int a=0;a<b;a++)
#define G F(k,3)F(l,2)
#define B a[l][j][k]
using namespace std;
mt19937 g;
int u[2][1 << 20], n, m, q, j, x[2][3];
int main() {
cin >> n >> m >> q, m++;
int a[2][n][3], h[n], z[n];
F(l, 2)F(j, n) {
F(k, 3)cin >> B;
h[j] = rand();
}
F(i, n) {
while (j < n) {
G x[l][k] = u[l][B];
F(k, 2)sort(x[k], x[k] + 3);
m = 0;
F(k, 3)if (x[0][k]^x[1][k])
m = 1;
if (m)
break;
G u[l][B] ^= h[j];
j++;
}
z[i] = j;
G u[l][a[l][i][k]] ^= h[i];
}
F(i, q)cin >> n >> m, cout << (z[n - 1] < m ? "No\n" : "Yes\n");
}
Details
Pretests
Pretest #1:
score: 5
Accepted
time: 1ms
memory: 3620kb
Pretest #2:
score: 5
Accepted
time: 0ms
memory: 3572kb
Pretest #3:
score: 5
Accepted
time: 0ms
memory: 3616kb
Pretest #4:
score: 5
Accepted
time: 0ms
memory: 3612kb
Pretest #5:
score: 5
Accepted
time: 1ms
memory: 3556kb
Pretest #6:
score: 5
Accepted
time: 0ms
memory: 3612kb
Pretest #7:
score: 5
Accepted
time: 1ms
memory: 3580kb
Pretest #8:
score: 5
Accepted
time: 1ms
memory: 3584kb
Pretest #9:
score: 5
Accepted
time: 107ms
memory: 3624kb
Pretest #10:
score: 5
Accepted
time: 95ms
memory: 3556kb
Pretest #11:
score: 5
Accepted
time: 231ms
memory: 9780kb
Pretest #12:
score: 5
Accepted
time: 257ms
memory: 9948kb
Pretest #13:
score: 5
Accepted
time: 0ms
memory: 3684kb
Pretest #14:
score: 5
Accepted
time: 0ms
memory: 3804kb
Pretest #15:
score: 5
Accepted
time: 479ms
memory: 3680kb
Pretest #16:
score: 5
Accepted
time: 520ms
memory: 3680kb
Pretest #17:
score: 5
Accepted
time: 13ms
memory: 4256kb
Pretest #18:
score: 5
Accepted
time: 22ms
memory: 4764kb
Pretest #19:
score: 5
Accepted
time: 803ms
memory: 9960kb
Pretest #20:
score: 5
Accepted
time: 808ms
memory: 14508kb
Final Tests
Test #1:
score: 5
Accepted
time: 1ms
memory: 3616kb
Test #2:
score: 5
Accepted
time: 0ms
memory: 3544kb
Test #3:
score: 5
Accepted
time: 0ms
memory: 3612kb
Test #4:
score: 5
Accepted
time: 0ms
memory: 3616kb
Test #5:
score: 5
Accepted
time: 1ms
memory: 3628kb
Test #6:
score: 5
Accepted
time: 0ms
memory: 3568kb
Test #7:
score: 5
Accepted
time: 0ms
memory: 3560kb
Test #8:
score: 5
Accepted
time: 0ms
memory: 3544kb
Test #9:
score: 5
Accepted
time: 80ms
memory: 3572kb
Test #10:
score: 5
Accepted
time: 91ms
memory: 3692kb
Test #11:
score: 5
Accepted
time: 236ms
memory: 9948kb
Test #12:
score: 5
Accepted
time: 264ms
memory: 9872kb
Test #13:
score: 5
Accepted
time: 3ms
memory: 3676kb
Test #14:
score: 5
Accepted
time: 4ms
memory: 3720kb
Test #15:
score: 5
Accepted
time: 495ms
memory: 3696kb
Test #16:
score: 5
Accepted
time: 535ms
memory: 3736kb
Test #17:
score: 5
Accepted
time: 13ms
memory: 4240kb
Test #18:
score: 5
Accepted
time: 22ms
memory: 4636kb
Test #19:
score: 5
Accepted
time: 763ms
memory: 9836kb
Test #20:
score: 5
Accepted
time: 824ms
memory: 14484kb
Extra Test:
score: 0
Extra Test Passed