結果

問題 No.73 helloworld
ユーザー GOTKAKO
提出日時 2025-06-30 00:27:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 619 bytes
コンパイル時間 2,081 ms
コンパイル使用メモリ 196,700 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-06-30 00:27:51
合計ジャッジ時間 2,721 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    vector<long long> C(26);
    for(auto &c : C) cin >> c;

    long long answer = 1;
    answer *= C.at('d'-'a');
    answer *= C.at('e'-'a');
    answer *= C.at('h'-'a');
    answer *= C.at('w'-'a');
    answer *= C.at('r'-'a');
    answer *= C.at('o'-'a')/2;
    answer *= (C.at('o'-'a')+1)/2;

    int maxl = 0;
    for(int i=1; i<=C.at('l'-'a')-2; i++){
        int left = C.at('l'-'a')-i;
        maxl = max(maxl,left*(left-1)/2*i);
    }    
    answer *= maxl;
    cout << answer << endl;
}
0