結果

問題 No.2255 Determinant Sum
ユーザー tailstails
提出日時 2023-03-25 16:21:23
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,153 bytes
コンパイル時間 890 ms
コンパイル使用メモリ 27,832 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 02:42:23
合計ジャッジ時間 1,895 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 0 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 0 ms
4,348 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:72:9: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
   72 |         write(1,wbuf,wp-wbuf);
      |         ^~~~~
main.c:73:9: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
   73 |         _exit(0);
      |         ^~~~~
main.c:73:9: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch]

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")

#define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);})
#define rd_skip_line() while(*rp++!=10)
#define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rep(v,e) for(typeof(e) v=0;v<e;++v)
#define rep3(v,s,e) for(typeof(e) v=s;v<e;++v)

typedef unsigned long ulong;
char wbuf[1<<25];

int main(){
	rd_init();
	rd_skip_line();
	char*wp=wbuf;
	while(*rp){
		int n=rd();
		int p=rd();
		if(p==2){
			int f=0;
			ulong d=0,e[50];
			rep(y,n){
				ulong b=0,c=0;
				rep(x,n){
					b<<=1;
					c<<=1;
					int a=*rp;
					rp+=2;
					if(a=='-'){
						rp+=1;
						b|=1;
					}
					c|=a&1;
				}
				if(b){
					if(b&(b-1|d)){
						n-=y+1;
						goto zerodayo;
					}
					d|=b;
				}else{
					e[f++]=c;
				}
			}
			rep(y,f){
				e[y]&=~d;
			}
			rep(y,f){
				ulong v=e[y];
				if(!v){
					goto zerodane;
				}
				ulong u=v&-v;
				rep3(z,y+1,n){
					if(e[z]&u){
						e[z]^=v;
					}
				}
			}
			*wp++='1';
		}else{
			zerodayo:;
			rep(y,n){
				rd_skip_line();
			}
			zerodane:;
			*wp++='0';
		}
		*wp++='\n';
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0