結果

問題 No.2110 012 Matching
ユーザー tailstails
提出日時 2022-10-28 22:52:26
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 970 bytes
コンパイル時間 1,012 ms
コンパイル使用メモリ 27,912 KB
実行使用メモリ 8,772 KB
最終ジャッジ日時 2023-09-20 06:04:08
合計ジャッジ時間 2,536 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 9 ms
6,320 KB
testcase_03 AC 6 ms
4,584 KB
testcase_04 AC 10 ms
7,820 KB
testcase_05 AC 8 ms
6,040 KB
testcase_06 AC 8 ms
5,932 KB
testcase_07 AC 13 ms
8,684 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 12 ms
8,772 KB
testcase_11 AC 0 ms
4,384 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:34:2: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
  write(1,wbuf,wp-wbuf);
  ^~~~~
main.c:35:2: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
  _exit(0);
  ^~~~~
main.c:35:2: warning: incompatible implicit declaration of built-in function ‘_exit’

ソースコード

diff #

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

#define WTHI(v) {ulong _z=v,_n=0,_d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(ulong*)wp=_d;wp+=_n;}
#define WTLO(v) {ulong _z=v,_n=8,_d=0;while(_d=_d<<8|0x30|_z%10,_z/=10,--_n);*(ulong*)wp=_d;wp+=8;}
#define wt(v) {ulong _v=v;if(_v>=100000000){if(_v>=10000000000000000l){WTHI(_v/10000000000000000l);WTLO(_v/100000000);}else WTHI(_v/100000000);WTLO(_v);}else{WTHI(_v);}}

#define rd_skip() while(*rp++>=48)
#define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rep(v,e) for(long v=0;v<e;++v)
#define min(a,b) (a<=b?a:b)

typedef unsigned long ulong;
char wbuf[1<<25];

int main(){
	char*mmap();
	char*rp=mmap(0l,1l<<25,1,2,0,0ll);
	char*wp=wbuf;
	rd_skip();
	while(*rp){
	    ulong a=rd();
	    ulong b=rd();
	    ulong c=rd();
		ulong d=b>>1;
		ulong e=min(a,c);
		a-=e;
		c-=e;
		ulong f=a?b&1:0;
		ulong g=c>>1;
		wt((d+e)*2+f+g);
		*wp++='\n';
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0