結果

問題 No.1915 Addition
ユーザー tailstails
提出日時 2022-04-29 21:43:53
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 1,833 ms
コンパイル使用メモリ 28,436 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-11 12:40:12
合計ジャッジ時間 3,628 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 0 ms
4,380 KB
testcase_07 AC 0 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 0 ms
4,376 KB
testcase_10 AC 0 ms
4,384 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:36:9: 警告: 関数 ‘write’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   36 |         write(1,wbuf,wp-wbuf);
      |         ^~~~~
main.c:37:9: 警告: implicit declaration of function ‘_exit’; did you mean ‘_Exit’? [-Wimplicit-function-declaration]
   37 |         _exit(0);
      |         ^~~~~
      |         _Exit

ソースコード

diff #

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

char wbuf[1<<25];

int main(){
	char*mmap();
	char*rp=mmap(0l,1l<<25,1,2,0,0ll);
	char*wp=wbuf;
	while(*rp++!=10);
	for(int c;c=*rp++;){
		c-='0';
		if(c>=5){
			*wp++='1';
			c-=5;
		}
		int d=c<<1;
		while(1){
			c=*rp++;
			if(c==10){
				*wp++=d+'0';
				*wp++='\n';
				break;				
			}
			else{
				c-='0';
				if(c>=5){
					++d;
					c-=5;
				}
				*wp++=d+'0';
				d=c<<1;
			}
		}
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0