結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー tailstails
提出日時 2023-12-04 10:52:10
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 620 bytes
コンパイル時間 924 ms
コンパイル使用メモリ 25,728 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2023-12-04 10:52:12
合計ジャッジ時間 1,860 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

#define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);})
#define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rep(v,e) for(typeof(e) v=0;v<e;++v)
#define rrep(v,e) for(typeof(e) v=e;v--;)

char wbuf[1<<25];

int main(){
	rd_init();
	char*wp=wbuf;
	rrep(t,rd()){
		unsigned m=rd();
		unsigned x=0;
		rep(i,9){
			int d=*rp-'0'; rp+=2;
			rep(j,d){
				x=x*10+(i+1);
				*wp++=i+'1';
			}
		}
		x=m-x*1000000000ull%m;
		rrep(i,9){
			wp[i]=x%10+'0';
			x/=10;
		}
		wp+=9;
		*wp++='\n';
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0