結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2016-03-06 18:31:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,176 bytes |
| コンパイル時間 | 781 ms |
| コンパイル使用メモリ | 83,904 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-24 14:48:08 |
| 合計ジャッジ時間 | 1,448 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 1 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 73.cc: No.73 helloworld - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
/* typedef */
typedef long long ll;
/* global variables */
int cs[26];
/* subroutines */
inline int alphcs(char a) { return cs[a - 'a']; }
/* main */
int main() {
for (int i = 0; i < 26; i++) cin >> cs[i];
int csl = alphcs('l'), cso = alphcs('o');
if (csl < 3 || cso < 2) {
puts("0");
return 0;
}
ll maxlcnt = 1, maxocnt = 1;
for (int i = 2, j = csl - 2; j >= 1; i++, j--) {
ll lcnt = (ll)i * (i - 1) / 2 * j;
if (maxlcnt < lcnt) maxlcnt = lcnt;
}
for (int i = 1, j = cso - 1; j >= 1; i++, j--) {
ll ocnt = (ll)i * j;
if (maxocnt < ocnt) maxocnt = ocnt;
}
ll cnt =
alphcs('h') * alphcs('e') * alphcs('w') * alphcs('r') * alphcs('d') *
maxlcnt * maxocnt;
printf("%lld\n", cnt);
return 0;
}
tnakao0123