結果

問題 No.2110 012 Matching
ユーザー tailstails
提出日時 2022-10-28 22:46:17
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 1,114 ms
コンパイル使用メモリ 26,684 KB
実行使用メモリ 9,752 KB
最終ジャッジ日時 2023-09-20 05:54:42
合計ジャッジ時間 2,610 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

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

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

int main(){
	char*mmap();
	char*rp=mmap(0l,1l<<25,1,2,0,0ll);
	long t=rd();
	rep(i,t){
	    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;
		r[i]=(d+e)*2+f+g;
	}
	{
		char*wp=wbuf+sizeof wbuf;
		rrep(i,t){
			*--wp='\n';
			wt(r[i]);
		}
		write(1,wp,wbuf+sizeof wbuf-wp);
	}
	_exit(0);
}
0