結果
| 問題 |
No.398 ハーフパイプ(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-21 18:11:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,173 bytes |
| コンパイル時間 | 775 ms |
| コンパイル使用メモリ | 78,768 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 01:47:38 |
| 合計ジャッジ時間 | 1,576 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 14 |
ソースコード
#include<iostream>
#include<map>
using namespace std;
typedef long long ll;
int main(){
double x;
cin >> x;
ll ans = 0, base[7];
base[0] = 1;
for(int i = 1; i < 7; i++) base[i] = base[i-1]*i;
for(int i = 0; i <= 100; i++){
for(int j = i; j <= 100; j++){
for(int k = j; k <= 100; k++){
for(int l = k; l <= 100; l++){
if((double)(i+j+k+l)/4!=x) continue;
// printf("%d %d %d %d\n", i, j, k, l);
ll tempb = base[6];
map<int,int> app;
app[i]++, app[j]++, app[k]++, app[l]++;
for(auto p : app){
tempb /= base[p.second];
}
if(i == 0){
if(l == 100){
tempb /= (++app[i]);
tempb /= (++app[l]);
ans += tempb;
}else{
tempb /= (++app[i]);
ans += (100-l) * tempb;
tempb /= (++app[l]);
ans += tempb;
}
}else{
if(l == 100){
tempb /= (++app[l]);
ans += i * tempb;
tempb /= (++app[i]);
ans += tempb;
}else{
ans += (i + 100 - l) * tempb;
tempb /= (++app[i]);
ans += (100-l) * tempb;
tempb *= (app[i]--);
tempb /= (++app[l]);
ans += i * tempb;
tempb *= (app[l]--);
tempb /= (++app[i]);
tempb /= (++app[l]);
ans += tempb;
}
}
}
}
}
}
cout << ans << endl;
return 0;
}