QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#101636 | #6380. LaLa and Divination Magic | runewrz# | WA | 3ms | 3788kb | C++20 | 1.2kb | 2023-04-30 16:02:33 | 2023-04-30 16:02:35 |
Judging History
answer
#include<bits/stdc++.h>
#define rep(i,a,b) for (int i = (a); i <= (b); ++i)
#define drep(i,a,b) for (int i = (a); i >= (b); --i)
#define LL long long
#define ULL unsigned LL
#define pii pair<int,int>
#define pll pair<LL,LL>
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back
using namespace std;
LL read() {
LL x = 0,y = 1; char ch = getchar(); while (!isdigit(ch)) {if (ch == '-') y = -y; ch = getchar();}
while (isdigit(ch)) {x = x*10+ch-'0'; ch = getchar();} return x*y;
}
namespace qiqi {
const int N = 2005; int n,m; char s[N]; vector<pair<pii,int>> ans; bitset<N> f[N][2];
void main() {
m = read(); n = read();
rep(i,1,m) {
scanf("%s",s+1);
rep(j,1,n) f[j][s[j]-'0'][i] = 1;
}
rep(i,1,n) {
rep(j,1,i-1) {
if ((f[j][0]&f[i][0]).none()) ans.eb(mp(mp(j,i),4));
if ((f[j][0]&f[i][1]).none()) ans.eb(mp(mp(j,i),2));
if ((f[j][1]&f[i][0]).none()) ans.eb(mp(mp(j,i),3));
if ((f[j][1]&f[i][1]).none()) ans.eb(mp(mp(j,i),1));
}
if (f[i][0].none()) ans.eb(mp(mp(i,i),4));
if (f[i][1].none()) ans.eb(mp(mp(i,i),1));
}
printf("%d\n",(int)ans.size());
for (auto [p,c]:ans) {
printf("%d %d %d\n",p.fi-1,p.se-1,c);
}
}
}
int main() {
qiqi::main(); return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3600kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #2:
score: 0
Accepted
time: 3ms
memory: 3604kb
input:
3 3 101 011 111
output:
6 0 1 4 0 2 4 0 2 3 1 2 4 1 2 3 2 2 4
result:
ok Kout = 6, Kans = 6
Test #3:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
2 1 0 1
output:
0
result:
ok Kout = 0, Kans = 0
Test #4:
score: 0
Accepted
time: 2ms
memory: 3740kb
input:
2 1 0 1
output:
0
result:
ok Kout = 0, Kans = 0
Test #5:
score: 0
Accepted
time: 2ms
memory: 3748kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #6:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
2 1 0 1
output:
0
result:
ok Kout = 0, Kans = 0
Test #7:
score: 0
Accepted
time: 2ms
memory: 3784kb
input:
2 1 0 1
output:
0
result:
ok Kout = 0, Kans = 0
Test #8:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #9:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
1 1 1
output:
1 0 0 4
result:
ok Kout = 1, Kans = 1
Test #10:
score: 0
Accepted
time: 1ms
memory: 3784kb
input:
1 1 0
output:
1 0 0 1
result:
ok Kout = 1, Kans = 1
Test #11:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #12:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #13:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
2 4 0111 0010
output:
15 0 0 1 0 1 3 0 1 1 0 2 4 0 2 3 0 2 1 1 2 4 1 2 3 2 2 4 0 3 3 0 3 1 1 3 2 1 3 3 2 3 4 2 3 2
result:
ok Kout = 15, Kans = 15
Test #14:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #15:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
4 2 10 11 01 00
output:
0
result:
ok Kout = 0, Kans = 0
Test #16:
score: 0
Accepted
time: 2ms
memory: 3576kb
input:
2 1 1 0
output:
0
result:
ok Kout = 0, Kans = 0
Test #17:
score: 0
Accepted
time: 2ms
memory: 3752kb
input:
2 4 0010 1000
output:
15 0 1 2 0 1 1 1 1 1 0 2 4 0 2 1 1 2 3 1 2 1 0 3 2 0 3 1 1 3 2 1 3 3 1 3 1 2 3 2 2 3 1 3 3 1
result:
ok Kout = 15, Kans = 15
Test #18:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
2 5 11101 00000
output:
21 0 1 2 0 1 3 0 2 2 0 2 3 1 2 2 1 2 3 0 3 2 0 3 1 1 3 2 1 3 1 2 3 2 2 3 1 3 3 1 0 4 2 0 4 3 1 4 2 1 4 3 2 4 2 2 4 3 3 4 3 3 4 1
result:
ok Kout = 21, Kans = 21
Test #19:
score: -100
Wrong Answer
time: 2ms
memory: 3752kb
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.