結果

問題 No.108 トリプルカードコンプ
ユーザー tailstails
提出日時 2023-02-24 18:23:07
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 7 ms / 5,000 ms
コード長 898 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 28,276 KB
実行使用メモリ 5,996 KB
最終ジャッジ日時 2023-10-11 03:25:21
合計ジャッジ時間 1,392 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
5,924 KB
testcase_01 AC 7 ms
5,924 KB
testcase_02 AC 7 ms
5,940 KB
testcase_03 AC 7 ms
5,924 KB
testcase_04 AC 7 ms
5,976 KB
testcase_05 AC 7 ms
5,844 KB
testcase_06 AC 7 ms
5,848 KB
testcase_07 AC 7 ms
5,872 KB
testcase_08 AC 7 ms
5,964 KB
testcase_09 AC 7 ms
5,932 KB
testcase_10 AC 7 ms
5,940 KB
testcase_11 AC 7 ms
5,876 KB
testcase_12 AC 7 ms
5,944 KB
testcase_13 AC 7 ms
5,844 KB
testcase_14 AC 7 ms
5,940 KB
testcase_15 AC 7 ms
5,976 KB
testcase_16 AC 7 ms
5,880 KB
testcase_17 AC 7 ms
5,876 KB
testcase_18 AC 7 ms
5,844 KB
testcase_19 AC 7 ms
5,904 KB
testcase_20 AC 7 ms
5,848 KB
testcase_21 AC 7 ms
5,996 KB
testcase_22 AC 7 ms
5,928 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘f2’:
main.c:42:2: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
  write(1,wp,wbuf+sizeof wbuf-wp);
  ^~~~~
main.c: In function ‘main’:
main.c:48:2: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
  _exit(0);
  ^~~~~
main.c:48:2: warning: incompatible implicit declaration of built-in function ‘_exit’

ソースコード

diff #

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

#define getrp() ({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);})
#define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define wt(v) ({unsigned _z=v;do*--wp=_z%10+48;while(_z/=10);})
#define rep(v,e) for(int v=0;v<e;++v)
#define rep3(v,s,e) for(int v=s;v<e;++v)

double _e[102][102][102];
#define e(a,b,c) _e[a+1][b+1][c+1]

static void f0(){
	rep(i,101){
		rep3(j,i,101){
			rep3(k,j?:1,101){
				e(i,j,k)=(i*e(i-1,j,k)+(j-i)*e(i,j-1,k)+(k-j)*e(i,j,k-1)+1)/k;
			}
		}
	}
}

static double f1(){
	char*rp=getrp();
	int n=rd();
	int c0=0,c1=0,c2=0;
	while(*rp){
		int a=rd();
		c0+=a<=0;
		c1+=a<=1;
		c2+=a<=2;
	}
	return n*e(c0,c1,c2);
}

static void f2(double z){
	char wbuf[64],*wp=wbuf+sizeof wbuf;
	*--wp='6';
	*--wp='-';
	*--wp='e';
	wt(z*1e6);
	write(1,wp,wbuf+sizeof wbuf-wp);
}

int main(){
	f0();
	f2(f1());
	_exit(0);
}
0