QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#241213 | #6552. Good and Lucky Matrices | manizare | 0 | 0ms | 0kb | C++14 | 1.1kb | 2023-11-06 00:26:56 | 2023-11-06 00:26:57 |
answer
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(a) a.begin(),a.end()
#define pii pair <int,int>
#define Pii pair<pii , pii>
using namespace std ;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 2002 , maxq = 1e7 + 1 , inf = 1e9 + 10 , mod=1e9 + 7 ,lg = 20 ;
bitset <maxn> s[maxn] ,a[maxn] ,b[maxn] ;
int bit[maxn] ;
signed main(){
ios::sync_with_stdio(0);cin.tie(0);
int t ;
cin >> t;
while(t--){
string t;
cin >> t;
int n;
cin >> n ;
for(int i = 1 ;i <= n; i ++){
s[i].reset() ;
a[i].reset() ;
b[i].reset();
for(int j = 1; j <= n; j++){
char x ;
cin >> x;
if(x=='1')b[i][j] = 1 ;
}
}
for(int i = 1; i <= n; i++)s[i][i] = 1;
for(int i = 1; i <= n;i++){
bitset <maxn> x ;
for(int j = 1; j <= n ; j++){
if(b[i][j] == 1){
x ^= s[j];
}
}
s[x._Find_first()] = x ;
for(int j = 1; j <= n; j++){
cout << x[j] ;
}
cout << "\n";
bit[i]= x._Find_first() ;
}
}
}
/*
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer on the first run
First Run Input
3 lucky 2 11 11 good 2 11 01 lucky 2 01 10
First Run Output
11 10 11 01 01 10
Second Run Input
Second Run Output
result:
wrong answer Line element row[1] equals to "10", doesn't correspond to pattern "[01]{11}" (test case 1)