結果

問題 No.73 helloworld
ユーザー @abcde@abcde
提出日時 2019-03-23 15:34:05
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 983 bytes
コンパイル時間 1,195 ms
コンパイル使用メモリ 144,660 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-14 15:30:06
合計ジャッジ時間 2,422 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

int main() {
    
    // 1. 入力情報取得.
    LL alphabet[26];
    for(int i = 0; i < 26; i++) cin >> alphabet[i];
    LL d = alphabet[3];
    LL e = alphabet[4];
    LL h = alphabet[7];
    LL l = alphabet[11];
    LL o = alphabet[14];
    LL r = alphabet[17];
    LL w = alphabet[22];
    // cout << "d="<< d << " e=" << e << " h=" << h << " l=" << l << " o=" << o << " r=" << r << " w=" << w << endl;
    
    // 2. 最大のhelloworld数は?
    // l の 並べ方 … iC2 × (l - i) が 最大になる i = im を使って, 計算.
    // o の 並べ方 … ((o + 1) / 2) × (o / 2) 通り.
    LL im = ((l + 1) + sqrt(0.0 + l * l - l + 1.0)) / 3;
    LL mL = max(im * (im - 1) / 2 * (l - im), (im + 1) * im / 2 * (l - im - 1));
    // cout << im << " " << mL << endl;
    LL ans = d * e * h * mL * ((o + 1) / 2) * (o / 2) * r * w;
    
    // 3. 出力.
    cout << ans << endl;
    return 0;
    
}
0