結果
問題 | No.73 helloworld |
ユーザー |
![]() |
提出日時 | 2015-07-29 23:28:57 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 489 bytes |
コンパイル時間 | 625 ms |
コンパイル使用メモリ | 54,648 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 02:34:53 |
合計ジャッジ時間 | 1,196 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <iostream>using namespace std;typedef long long LL;LL calc_l(LL n) {LL cnt = 0;for (LL a = 2; a < n; ++a) {LL t = (a * (a - 1) / 2) * (n - a);cnt = max(cnt, t);}return cnt;}int main(int argc, char *argv[]){LL cnt[256] = {};for (int i = 'a'; i <= 'z'; ++i) {cin >> cnt[i];}LL ans = cnt['h'] * cnt['e'] * calc_l(cnt['l']);LL o = cnt['o'];ans *= (o / 2) * (o - o / 2);ans *= cnt['r'] * cnt['w'] * cnt['d'];cout << ans << endl;return 0;}