結果

問題 No.398 ハーフパイプ(2)
ユーザー りあんりあん
提出日時 2016-07-15 13:35:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,582 bytes
コンパイル時間 537 ms
コンパイル使用メモリ 67,036 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 21:57:45
合計ジャッジ時間 1,385 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    int a, b;
    scanf("%d.%d", &a, &b);
    int sum = (a * 100 + b) / 25;
    long long ans = 0;
    
    for (int i = 0; i < 101; ++i) {
        if (i * 4 > sum || i + 300 < sum) continue;
        
        for (int j = i; j < 101; ++j) {
            if (i + j * 3 > sum || i + j + 200 < sum) continue;
            
            for (int k = j; k < 101; ++k) {
                int l = sum - i - j - k;
                if (l < 0 || l > 100) continue;
                
                if (i < j && j < k && k < l)
                    ans += 180 + (i + 100 - l) * 360 + i * (100 - l) * 720;
                if (i == j && j < k && k < l)
                    ans += 60 + i * 180 + (100 - l) * 120 + i * (100 - l) * 360;
                if (i < j && j == k && k < l)
                    ans += 90 + (i + 100 - l) * 180 + i * (100 - l) * 360;
                if (i < j && j < k && k == l)
                    ans += 60 + i * 120 + (100 - l) * 180 + i * (100 - l) * 360;
                if (i == j && j < k && k == l)
                    ans += 20 + (i + 100 - l) * 60 + i * (100 - l) * 180;
                if (i == j && j == k && k < l)
                    ans += 15 + i * 60 + (100 - l) * 30 + i * (100 - l) * 120;
                if (i < j && j == k && k == l)
                    ans += 15 + i * 30 + (100 - l) * 60 + i * (100 - l) * 120;
                if (i == j && j == k && k == l)
                    ans += 1 + (i + 100 - l) * 6 + i * (100 - l) * 30;
            }
        }
    }
    cout << ans << "\n";
    return 0;
}
0