結果

問題 No.73 helloworld
ユーザー phsplsphspls
提出日時 2020-04-05 22:36:43
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 856 bytes
コンパイル時間 1,429 ms
コンパイル使用メモリ 166,880 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-17 19:02:37
合計ジャッジ時間 2,183 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 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];
    result *= temp[4];
    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];
    result *= temp[17];
    result *= temp[3];

    cout << result << endl;
}
0