結果

問題 No.108 トリプルカードコンプ
ユーザー tailstails
提出日時 2023-02-24 18:39:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 597 bytes
コンパイル時間 6,181 ms
コンパイル使用メモリ 330,924 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 03:41:33
合計ジャッジ時間 7,517 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,352 KB
testcase_12 WA -
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,352 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,352 KB
testcase_21 AC 1 ms
4,352 KB
testcase_22 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#include<bits/stdc++.h>
using namespace std;

#define e(a,b,c) _e[a+1][b+1][c+1]
#define rep(v,e) for(int v=0;v<e;++v)
#define rep3(v,s,e) for(int v=s;v<e;++v)

struct Hoge {
	double _e[102][102][102];
	constexpr Hoge():_e(){
		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;
				}
			}
		}
	}
};

constexpr Hoge h;

int main(){
	int n,c0=0,c1=0,c2=0;
	cin>>n;
	rep(i,n){
		int a;
		cin>>a;
		c0+=a<=0;
		c1+=a<=1;
		c2+=a<=2;
	}
	cout<<n*h.e(c0,c1,c2);
	return 0;
}
0