結果

問題 No.1032 数数え
ユーザー tailstails
提出日時 2020-11-02 21:41:07
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 839 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 31,012 KB
実行使用メモリ 4,964 KB
最終ジャッジ日時 2023-09-29 13:48:26
合計ジャッジ時間 1,094 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

main(){
	//char*rp=mmap(0l,7l*200002,1,2,0,0ll);
	read(0,buf,sizeof buf);
	char*rp=buf;
	RD(n); RD(m);
	while(n--){
		RD(l);
		++h[l];
	}
	char*wp=buf;
	for(int i=0;++i<=m;){
		int d,v;
		v=i;
		wp+=6;
		*--wp=v%10+48;v/=10;
		*--wp=v?d=v%10,v/=10,d+48:32;
		*--wp=v?d=v%10,v/=10,d+48:32;
		*--wp=v?d=v%10,v/=10,d+48:32;
		*--wp=v?d=v%10,v/=10,d+48:32;
		*--wp=v?d=v%10,v/=10,d+48:32;
		wp+=6;
		*wp++=32;
		v=h[i];
		wp+=6;
		*--wp=v%10+48;v/=10;
		*--wp=v?d=v%10,v/=10,d+48:32;
		*--wp=v?d=v%10,v/=10,d+48:32;
		*--wp=v?d=v%10,v/=10,d+48:32;
		*--wp=v?d=v%10,v/=10,d+48:32;
		*--wp=v?d=v%10,v/=10,d+48:32;
		wp+=6;
		*wp++=10;
	}
	write(1,buf,wp-buf);
	_exit(0);
}
0