結果

問題 No.73 helloworld
ユーザー phsplsphspls
提出日時 2020-04-05 22:34:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 921 bytes
コンパイル時間 1,647 ms
コンパイル使用メモリ 164,748 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-17 18:58:19
合計ジャッジ時間 2,463 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define llong long long

int comb(int n, int k) {
    int result = 1;
    rep(i, k) result *= (n-i);
    rep(i, k) result /= i+1;
    return result;
}

int max_comb(int n) {
    int ret = 1;
    for(int i=2; i<n; i++) {
        int ee = comb(i, 2);
        int er = n-i;
        ret = max(ret, ee * er);
    }
    return ret;
}

int main() {
    //string alphabets = "abcdefghijklmnopqrstuvwxyz";
    vector<int> temp(26);
    rep(i, 26) cin >> temp[i];
    llong result = 1;
    result *= temp[7] == 0 ? 0 : 1;
    result *= temp[4] == 0 ? 0 : 1;
    result *= temp[11] < 3 ? 0 : max_comb(temp[11]);
    result *= temp[14] < 2 ? 0 : (temp[14] / 2 * (temp[14] / 2 + temp[14] % 2));
    result *= temp[22] == 0 ? 0 : 1;
    result *= temp[17] == 0 ? 0 : 1;
    result *= temp[3] == 0 ? 0 : 1;

    cout << result << endl;
}
0