結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
kyuna
|
| 提出日時 | 2019-08-11 12:29:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 595 bytes |
| コンパイル時間 | 1,130 ms |
| コンパイル使用メモリ | 83,656 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-13 12:36:01 |
| 合計ジャッジ時間 | 1,487 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
int main() {
map<char, int> cnt;
for (char c = 'a'; c <= 'z'; c++) cin >> cnt[c];
long long ans = 1;
for (char c: "hewrd") if (c) ans *= cnt[c];
int ma_l = 0;
for (int i = 2; i < cnt['l']; i++) {
int tmp = (i * (i - 1) / 2) * (cnt['l'] - i);
ma_l = max(ma_l, tmp);
}
int ma_o = 0;
for (int i = 1; i < cnt['o']; i++) {
int tmp = i * (cnt['o'] - i);
ma_o = max(ma_o, tmp);
}
cout << ans * ma_l * ma_o << endl;
return 0;
}
kyuna