QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#101608 | #6380. LaLa and Divination Magic | willow# | WA | 3ms | 7880kb | C++14 | 944b | 2023-04-30 14:19:57 | 2023-04-30 14:20:23 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int maxn = 2005;
char s[maxn][maxn];
int n, m;
bitset<maxn>w[maxn][2], f[2][2][maxn];
vector<pair<pair<int, int>, int> > ans;
int main() {
scanf("%d%d", &n, &m);
for(int i = 0; i < n; ++ i) {
scanf("%s", s[i]);
for(int j = 0; j < m; ++ j) {
w[i][s[i][j] - '0'][j] = 1;
}
for(int j = 0; j < m; ++ j) {
if(s[i][j] - '0') {
f[1][0][j] |= w[i][0];
f[1][1][j] |= w[i][1];
}
else {
f[0][0][j] |= w[i][0];
f[0][1][j] |= w[i][1];
}
}
}
for(int a = 0; a < 2; ++ a)
for(int b = 0; b < 2; ++ b)
for(int i = 0; i < m; ++ i)
for(int j = i; j < m; ++ j) {
if(i == j && a != b)
continue;
if(f[a ^ 1][b ^ 1][i][j])
continue;
ans.push_back({{i, j}, a + b * 2 + 1});
}
printf("%d\n", (int)ans.size());
for(auto w : ans)
printf("%d %d %d\n", w.first.first, w.first.second, w.second);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 7636kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #2:
score: 0
Accepted
time: 2ms
memory: 5640kb
input:
3 3 101 011 111
output:
6 0 2 3 1 2 3 0 1 4 0 2 4 1 2 4 2 2 4
result:
ok Kout = 6, Kans = 6
Test #3:
score: 0
Accepted
time: 2ms
memory: 7848kb
input:
2 1 0 1
output:
0
result:
ok Kout = 0, Kans = 0
Test #4:
score: 0
Accepted
time: 2ms
memory: 5656kb
input:
2 1 0 1
output:
0
result:
ok Kout = 0, Kans = 0
Test #5:
score: 0
Accepted
time: 1ms
memory: 7632kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #6:
score: 0
Accepted
time: 0ms
memory: 5836kb
input:
2 1 0 1
output:
0
result:
ok Kout = 0, Kans = 0
Test #7:
score: 0
Accepted
time: 2ms
memory: 5648kb
input:
2 1 0 1
output:
0
result:
ok Kout = 0, Kans = 0
Test #8:
score: 0
Accepted
time: 1ms
memory: 7880kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #9:
score: 0
Accepted
time: 2ms
memory: 5580kb
input:
1 1 1
output:
1 0 0 4
result:
ok Kout = 1, Kans = 1
Test #10:
score: 0
Accepted
time: 1ms
memory: 7672kb
input:
1 1 0
output:
1 0 0 1
result:
ok Kout = 1, Kans = 1
Test #11:
score: 0
Accepted
time: 1ms
memory: 7856kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #12:
score: 0
Accepted
time: 3ms
memory: 7848kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #13:
score: 0
Accepted
time: 3ms
memory: 7640kb
input:
2 4 0111 0010
output:
15 0 0 1 0 1 1 0 2 1 0 3 1 0 1 3 0 2 3 0 3 3 1 2 3 1 3 3 1 3 2 2 3 2 0 2 4 1 2 4 2 2 4 2 3 4
result:
ok Kout = 15, Kans = 15
Test #14:
score: 0
Accepted
time: 1ms
memory: 5572kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #15:
score: 0
Accepted
time: 0ms
memory: 5644kb
input:
4 2 10 11 01 00
output:
0
result:
ok Kout = 0, Kans = 0
Test #16:
score: 0
Accepted
time: 2ms
memory: 7680kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #17:
score: 0
Accepted
time: 0ms
memory: 5652kb
input:
2 4 0010 1000
output:
15 0 1 1 0 2 1 0 3 1 1 1 1 1 2 1 1 3 1 2 3 1 3 3 1 1 2 3 1 3 3 0 1 2 0 3 2 1 3 2 2 3 2 0 2 4
result:
ok Kout = 15, Kans = 15
Test #18:
score: 0
Accepted
time: 0ms
memory: 5584kb
input:
2 5 11101 00000
output:
21 0 3 1 1 3 1 2 3 1 3 3 1 3 4 1 0 1 3 0 2 3 0 4 3 1 2 3 1 4 3 2 4 3 3 4 3 0 1 2 0 2 2 0 3 2 0 4 2 1 2 2 1 3 2 1 4 2 2 3 2 2 4 2
result:
ok Kout = 21, Kans = 21
Test #19:
score: -100
Wrong Answer
time: 0ms
memory: 5824kb
input:
5 4 0010 1001 0011 0101 1011
output:
5 0 1 1 1 2 1 0 3 3 1 3 3 2 3 4
result:
wrong answer The output contains more solutions than intended.