結果

問題 No.351 市松スライドパズル
ユーザー tailstails
提出日時 2021-02-22 16:32:53
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 501 bytes
コンパイル時間 1,095 ms
コンパイル使用メモリ 30,352 KB
実行使用メモリ 14,044 KB
最終ジャッジ日時 2023-10-21 11:41:38
合計ジャッジ時間 3,603 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
11,220 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 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 1 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 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 14 ms
13,868 KB
testcase_14 AC 14 ms
13,912 KB
testcase_15 AC 14 ms
14,040 KB
testcase_16 AC 15 ms
14,040 KB
testcase_17 AC 9 ms
14,040 KB
testcase_18 AC 10 ms
14,040 KB
testcase_19 AC 13 ms
14,044 KB
testcase_20 AC 14 ms
14,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:10:1: warning: return type defaults to 'int' [-Wimplicit-int]
   10 | main(){
      | ^~~~
main.c: In function 'main':
main.c:33:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
   33 |         write(1,x+y&1?"black":"white",5);
      |         ^~~~~
main.c:34:9: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration]
   34 |         _exit(0);
      |         ^~~~~
      |         _Exit

ソースコード

diff #

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

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

char s[1234567];
int k[1234567];

main(){
	char*rp=mmap(0l,1l<<28,1,2,0,0ll);
	RD(h);
	RD(w);
	RD(n);
	for(int i=0;i<n;++i){
		s[i]=*rp;
		rp+=2;
		RD(ki);
		k[i]=ki;
	}
	int x=0,y=0;
	for(int i=n;i--;){
		if(s[i]=='R'){
			if(y==k[i]&&--x<0){
				x=w-1;
			}
		}else{
			if(x==k[i]&&--y<0){
				y=h-1;
			}
		}
	}
	write(1,x+y&1?"black":"white",5);
	_exit(0);
}
0