結果

問題 No.1032 数数え
ユーザー tailstails
提出日時 2020-11-16 21:10:05
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 806 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 29,924 KB
実行使用メモリ 5,136 KB
最終ジャッジ日時 2023-09-30 07:29:40
合計ジャッジ時間 1,331 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 6 ms
5,136 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 0 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 6 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:13:1: 警告: 戻り値の型をデフォルトの ‘int’ にします [-Wimplicit-int]
   13 | main(){
      | ^~~~
main.c: 関数 ‘main’ 内:
main.c:32:9: 警告: 関数 ‘write’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   32 |         write(1,buf,(wp-buf)*sizeof*buf);
      |         ^~~~~
main.c:33:9: 警告: implicit declaration of function ‘_exit’; did you mean ‘_Exit’? [-Wimplicit-function-declaration]
   33 |         _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 buf[8*2*200000];
int h[200001];

#define WTSP(v) {long _z=v,_n=1,_d=32;while(++_n,_d=_d<<8|0x30|_z&15,_z>>=4);*(long*)wp=_d;wp+=_n;}
#define WTLN(v) {long _z=v,_n=1,_d=10;while(++_n,_d=_d<<8|0x30|_z&15,_z>>=4);*(long*)wp=_d;wp+=_n;}

main(){
	char*rp=mmap(0l,7l*200002,1,2,0,0ll);
	while(*rp++!=32);
	RD(m);
	do{
		RD(l);
		int x=h[l];
		int y=x&x>>3;
		x+=y&1?y&0x10?y&0x100?y&0x1000?y&0x10000?0x66667:0x6667:0x667:0x67:7:1;
		h[l]=x;
	}while(*rp);
	char*wp=buf;
	int z=0;
	for(int i=0;++i<=m;){
		int y=z&z>>3;
		z+=y&1?y&0x10?y&0x100?y&0x1000?y&0x10000?0x66667:0x6667:0x667:0x67:7:1;
		WTSP(z);
		WTLN(h[i]);
	}
	write(1,buf,(wp-buf)*sizeof*buf);
	_exit(0);
}
0