結果

問題 No.250 atetubouのzetubou
ユーザー tailstails
提出日時 2020-11-11 16:15:59
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 835 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 30,840 KB
実行使用メモリ 37,008 KB
最終ジャッジ日時 2023-09-30 00:34:23
合計ジャッジ時間 3,231 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
36,712 KB
testcase_01 AC 28 ms
36,568 KB
testcase_02 AC 29 ms
37,008 KB
testcase_03 AC 28 ms
36,860 KB
testcase_04 AC 29 ms
36,904 KB
testcase_05 AC 29 ms
36,880 KB
testcase_06 AC 29 ms
36,888 KB
testcase_07 AC 29 ms
36,652 KB
testcase_08 AC 29 ms
36,812 KB
testcase_09 AC 29 ms
36,796 KB
testcase_10 AC 29 ms
36,868 KB
testcase_11 AC 28 ms
36,852 KB
testcase_12 AC 30 ms
36,860 KB
testcase_13 AC 29 ms
36,752 KB
testcase_14 AC 29 ms
36,548 KB
testcase_15 AC 29 ms
36,840 KB
testcase_16 AC 28 ms
36,756 KB
testcase_17 AC 29 ms
36,868 KB
testcase_18 AC 29 ms
36,828 KB
testcase_19 AC 29 ms
36,856 KB
testcase_20 AC 28 ms
36,568 KB
testcase_21 AC 28 ms
36,544 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:24:1: 警告: 戻り値の型をデフォルトの ‘int’ にします [-Wimplicit-int]
   24 | main(){
      | ^~~~
main.c: 関数 ‘main’ 内:
main.c:25:16: 警告: implicit declaration of function ‘shmget’; did you mean ‘shmat’? [-Wimplicit-function-declaration]
   25 |         int id=shmget(101,8l*3000*1500,950);
      |                ^~~~~~
      |                shmat
main.c:45:9: 警告: 関数 ‘write’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   45 |         write(1,wbuf,wp-wbuf);
      |         ^~~~~
main.c:46:9: 警告: implicit declaration of function ‘_exit’; did you mean ‘_Exit’? [-Wimplicit-function-declaration]
   46 |         _exit(0);
      |         ^~~~~
      |         _Exit

ソースコード

diff #

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

void*shmat();
void*mmap();
#define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}
#define RDL(v) long v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}

char wbuf[8*10000];

#define TMAX 1000000000000000l

void mkc(long(*c)[1500]){
	c[0][0]=1;
	for(int i=1;i<3000;++i){
		c[i][0]=1;
		for(int j=1;j<1500;++j){
			long x=c[i-1][j-1]+c[i-1][j];
			c[i][j]=x<(TMAX+1)?x:(TMAX+1);
		}
	}
}

main(){
	int id=shmget(101,8l*3000*1500,950);
	long(*c)[1500]=shmat(id,0l,0);
	if(c[0][0]==0){
		mkc(c);
	}
	char*rp=mmap(0l,27l*10000+6,1,2,0,0ll);
	char*wp=wbuf;
	while(*rp++!=10);
	do{
		RD(d);
		RD(x);
		RDL(t);
		if(c[x+d-1][d-1]>t){
			*(long*)wp=0x0a554f425554455al;
			wp+=8;
		}else{
			*(int*)wp=0x0a4341;
			wp+=3;
		}
	}while(*rp);
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0