結果
問題 | No.73 helloworld |
ユーザー |
![]() |
提出日時 | 2020-05-11 13:10:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 578 bytes |
コンパイル時間 | 1,508 ms |
コンパイル使用メモリ | 167,768 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 09:14:03 |
合計ジャッジ時間 | 2,299 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int C[30] = {}; for (int i = 0; i < 26; i++) { cin >> C[i]; } string s = "hewrd"; long long ans = 1; for (auto& c : s) ans *= C[c - 'a']; int s1, s2; s1 = C['o' - 'a'] / 2; s2 = C['o' - 'a'] - s1; ans *= s1 * s2; int MAX = 0; if (C['l' - 'a'] < 3) MAX = 0; else { for (int i = 2; i < C['l' - 'a']; i++) { MAX = max(MAX, i * (i - 1) / 2 * (C['l' - 'a'] - i)); } } ans *= MAX; cout << ans << endl; }