結果

問題 No.73 helloworld
ユーザー hogeover30
提出日時 2015-02-05 02:33:36
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 54,616 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 22:14:00
合計ジャッジ時間 1,036 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main()
{
    int a[128]={};
    for(int i=0;i<26;++i) cin>>a['a'+i];
    auto x=1LL;
    for(char c: "hewrd") if (c) x*=a[c];
    int o=a['o'];
    x*=o/2*(o-o/2);

    auto res=0LL;
    int n=a['l'];
    for(int i=2;i<n;++i) {
        auto t=x*i*(i-1)/2*(n-i);
        if (t>res) res=t;
    }
    cout<<res<<endl;
}
0