結果
| 問題 |
No.398 ハーフパイプ(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-14 02:35:33 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 1,161 bytes |
| コンパイル時間 | 1,825 ms |
| コンパイル使用メモリ | 167,628 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 15:38:07 |
| 合計ジャッジ時間 | 2,307 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int hoge(int a, int b, int c, int d, int i, int j) {
return a * i * (100 - j) + b * i + c * (100 - j) + d;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
double X;
cin >> X;
int sum = (int)(X * 4);
ll ans = 0;
for (int i = 0; i <= 100; i++) {
for (int k = i; k <= 100; k++) {
for (int l = k; l <= 100; l++) {
int j = sum - i - k - l;
if (j < 0 || j > 100 || l > j) continue;
if (i == k) {
if (k == l) {
if (l == j) {
ans += hoge(30, 6, 6, 1, i, j);
} else {
ans += hoge(120, 60, 30, 15, i, j);
}
} else {
if (l == j) {
ans += hoge(180, 60, 60, 20, i, j);
} else {
ans += hoge(360, 180, 120, 60, i, j);
}
}
} else {
if (k == l) {
if (l == j) {
ans += hoge(120, 30, 60, 15, i, j);
} else {
ans += hoge(360, 180, 180, 90, i, j);
}
} else {
if (l == j) {
ans += hoge(360, 120, 180, 60, i, j);
} else {
ans += hoge(720, 360, 360, 180, i, j);
}
}
}
}
}
}
cout << ans << endl;
return 0;
}