結果

問題 No.1658 Product / Sum
ユーザー tailstails
提出日時 2021-08-27 22:36:45
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 679 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 32,896 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-01 03:19:47
合計ジャッジ時間 1,824 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,948 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:11:1: warning: return type defaults to 'int' [-Wimplicit-int]
   11 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:9: warning: implicit declaration of function 'read'; did you mean 'rd'? [-Wimplicit-function-declaration]
   13 |         read(0,rbuf,sizeof rbuf);
      |         ^~~~
      |         rd
main.c:26:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
   26 |         write(1,wbuf,wp-wbuf);
      |         ^~~~~
main.c:27:9: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration]
   27 |         _exit(0);
      |         ^~~~~
      |         _Exit

ソースコード

diff #

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

#define rd(v) long v=0;{long _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}
#define WTHI(v) {long _z=v,_n=0,_d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(long*)wp=_d;wp+=_n;}
#define WTLO(v) {long _z=v,_n=8,_d=0;while(_d=_d<<8|0x30|_z%10,_z/=10,--_n);*(long*)wp=_d;wp+=8;}
#define wt(v) if(v>=100000000){WTHI(v/100000000);WTLO(v);}else{WTHI(v);}

char wbuf[1<<25];

main(){
	char rbuf[64];
	read(0,rbuf,sizeof rbuf);
	char*rp=rbuf;
	rd(n);
	rd(k);
	char*wp=wbuf;
	for(long i=0;i<n;i+=4){
		*(long*)wp=0x3120312031203120l;
		wp+=8;
	}
	wp=wbuf+(n-2)*2+1;
	wt(k+1);
	*wp++=' ';
	wt(k*(n+k-1));
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0