QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#241210#6552. Good and Lucky Matricesmanizare0 0ms0kbC++141.1kb2023-11-06 00:25:412023-11-06 00:25:41

Judging History

你现在查看的是最新测评结果

  • [2023-11-06 00:25:41]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-11-06 00:25:41]
  • 提交

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() ;
		}
		cout << "\n"; 
	}
}
/*

*/

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)