結果

問題 No.2255 Determinant Sum
ユーザー tailstails
提出日時 2023-03-25 16:04:15
言語 cLay
(20240104-1)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 3,362 ms
コンパイル使用メモリ 175,752 KB
実行使用メモリ 4,684 KB
最終ジャッジ日時 2023-10-19 02:30:22
合計ジャッジ時間 4,478 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 7 ms
4,684 KB
testcase_07 AC 4 ms
4,348 KB
testcase_08 AC 4 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 6 ms
4,684 KB
testcase_11 AC 3 ms
4,348 KB
testcase_12 AC 3 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 5 ms
4,348 KB
testcase_15 AC 3 ms
4,348 KB
testcase_16 AC 5 ms
4,552 KB
testcase_17 AC 4 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 3 ms
4,348 KB
testcase_20 AC 3 ms
4,348 KB
testcase_21 AC 3 ms
4,348 KB
testcase_22 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@t;
rep(t){
	ll@n,@p,@a[n][n];
	if(p==2){
		ull d=0,e[50],f=0;
		rep(y,n){
			ull b=0,c=0;
			rrep(x,n){
				b=b<<1|a[y][x]==-1;
				c=c<<1|a[y][x]==1;
			}
			if(b&(b-1|d)){
				goto zero;
			}
			d|=b;
			if(!b){
				e[f++]=c;
			}
		}
		rep(y,f){
			e[y]&=~d;
		}
		rep(y,f){
			ull v=e[y];
			if(!v){
				goto zero;
			}
			ull u=v&-v;
			rep(z,y+1,n){
				if(e[z]&u){
					e[z]^=v;
				}
			}
		}
		wt(1);
	}else{
		zero:;
		wt(0);
	}
}
0