結果

問題 No.2030 Googol Strings
ユーザー tailstails
提出日時 2022-08-06 01:54:27
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 633 bytes
コンパイル時間 1,330 ms
コンパイル使用メモリ 24,900 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 04:01:24
合計ジャッジ時間 3,276 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

#define rd_skip_line() while(*rp++!=10)

char wbuf[1<<25];

int main(){
	char*mmap();
	char*rp=mmap(0l,1l<<25,1,2,0,0ll);
	rd_skip_line();
	char*wp=wbuf;
	while(*rp){
		char*sx=rp; rd_skip_line();
		char*sy=rp; rd_skip_line();
		char*px=sx;
		char*py=sy;
		long z='X';
		while(1){
			if(*px==10){
				if(*py==10){
					break;
				}
				z='X';
				px=sy;
			}
			if(*py==10){
				z='Y';
				py=sx;
			}
			if(*px>*py){
				z='X';
				break;
			}
			if(*px<*py){
				z='Y';
				break;
			}
			++px;
			++py;
		}
		*wp++=z;
		*wp++='\n';
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0