結果
問題 | No.73 helloworld |
ユーザー |
|
提出日時 | 2015-02-18 23:38:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 657 bytes |
コンパイル時間 | 519 ms |
コンパイル使用メモリ | 61,140 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 22:17:29 |
合計ジャッジ時間 | 1,189 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <utility> using namespace std; int main() { int c; vector<int> alpha(26, 0); for (int i = 0; i < 26; i++) { cin >> c; alpha[i] = c; } //helloworld long long ans; // l 2 1 int nl = alpha['l' - 'a']; int max_l = 0; for (int i = 2; i <= nl - 1; i++) { max_l = max(max_l, i * (i - 1) / 2 * (nl - i)); } ans = max_l; // o 1 1 int no = alpha['o' - 'a']; ans *= no / 2 * (no - no / 2); ans *= alpha['h' - 'a']; ans *= alpha['e' - 'a']; ans *= alpha['w' - 'a']; ans *= alpha['r' - 'a']; ans *= alpha['d' - 'a']; cout << ans << endl; return 0; }