結果

問題 No.398 ハーフパイプ(2)
ユーザー yosupotyosupot
提出日時 2016-07-15 22:47:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 1,286 bytes
コンパイル時間 984 ms
コンパイル使用メモリ 101,840 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 22:00:06
合計ジャッジ時間 2,852 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <vector>
#include <valarray>
#include <array>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <complex>
#include <random>

using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr int TEN(int n) {return (n==0)?1:10*TEN(n-1);}

using Q = array<int, 6>;
int coun(Q q) {
    sort(q.begin(), q.end());
    int u = 0;
    do {
        u++;
    } while (next_permutation(q.begin(), q.end()));
    return u;
}
int main() {
    double _x;
    cin >> _x;
    _x *= 4;
    int x = int(round(_x));
    ll co = 0;
    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 (i+j+k+l != x) continue;
                    int x = i, y = 100-l;
                    co += x*y*coun(Q{-1, i, j, k, l, 101});
                    co += y*coun(Q{i, i, j, k, l, 101});
                    co += x*coun(Q{-1, i, j, k, l, l});
                    co += coun(Q{i, i, j, k, l, l});
                }
            }
        }
    }
    cout << co << endl;
    return 0;
}
0