結果

問題 No.1801 Segment Game
ユーザー tailstails
提出日時 2023-01-30 18:59:10
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 513 ms
コンパイル使用メモリ 25,644 KB
実行使用メモリ 4,612 KB
最終ジャッジ日時 2023-09-12 16:44:41
合計ジャッジ時間 1,763 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 4 ms
4,540 KB
testcase_02 AC 4 ms
4,548 KB
testcase_03 AC 4 ms
4,580 KB
testcase_04 AC 4 ms
4,588 KB
testcase_05 AC 4 ms
4,592 KB
testcase_06 AC 4 ms
4,580 KB
testcase_07 AC 4 ms
4,612 KB
testcase_08 AC 5 ms
4,532 KB
testcase_09 AC 4 ms
4,588 KB
testcase_10 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:19:33: warning: multi-character character constant [-Wmultichar]
   *(int*)wp=h+(w&1)>d&w+(h&1)>d?'\nS':'\nN';
                                 ^~~~~
main.c:19:39: warning: multi-character character constant [-Wmultichar]
   *(int*)wp=h+(w&1)>d&w+(h&1)>d?'\nS':'\nN';
                                       ^~~~~
main.c:22:2: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
  write(1,wbuf,wp-wbuf);
  ^~~~~
main.c:23:2: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
  _exit(0);
  ^~~~~
main.c:23:2: warning: incompatible implicit declaration of built-in function ‘_exit’

ソースコード

diff #

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

#define getrp() ({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);})
#define rd_skip() while(*rp++>=48)
#define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})

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

int main(){
	char*rp=getrp();
	char*wp=wbuf;
	rd_skip();
	while(*rp){
		long h=rd(); h*=h;
		long w=rd(); w*=w;
		long d=rd(); d*=d;
		*(int*)wp=h+(w&1)>d&w+(h&1)>d?'\nS':'\nN';
		wp+=2;
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0