結果
| 問題 | No.73 helloworld |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-10 02:16:06 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 285µs | |
| コード長 | 443 bytes |
| 記録 | |
| コンパイル時間 | 2,879 ms |
| コンパイル使用メモリ | 172,732 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-10 02:16:10 |
| 合計ジャッジ時間 | 4,138 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
ll cnt[26];
for(int i=0; i<26; i++) cin >> cnt[i];
ll ans=1;
string s="hewrd";
for(int i=0; i<s.size(); i++) ans*=cnt[s[i]-'a'];
ll nl=cnt['l'-'a'], no=cnt['o'-'a'];
ans*=(no/2)*(no-no/2);
ll mx=0;
for(int i=2; i<nl; i++){
mx=max(mx, i*(i-1)/2*(nl-i));
}
ans*=mx;
cout << ans << endl;
return 0;
}