結果
問題 | No.73 helloworld |
ユーザー |
|
提出日時 | 2017-07-20 19:15:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,173 bytes |
コンパイル時間 | 1,431 ms |
コンパイル使用メモリ | 166,096 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 01:42:25 |
合計ジャッジ時間 | 1,980 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>#define show(x) cout << #x << " = " << x << endlusing namespace std;using ll = long long;using pii = pair<int, int>;using vi = vector<int>;template <typename T>ostream& operator<<(ostream& os, const vector<T>& v){os << "sz=" << v.size() << "\n[";for (const auto& p : v) {os << p << ",";}os << "]\n";return os;}template <typename S, typename T>ostream& operator<<(ostream& os, const pair<S, T>& p){os << "(" << p.first << "," << p.second<< ")";return os;}constexpr ll MOD = 1e9 + 7;template <typename T>constexpr T INF = numeric_limits<T>::max() / 100;int alpha[26];int main(){ll num = 1;for (ll i = 0; i < 26; i++) {cin >> alpha[i];}num *= alpha['h' - 'a'];num *= alpha['e' - 'a'];num *= alpha['w' - 'a'];num *= alpha['r' - 'a'];num *= alpha['d' - 'a'];num *= (alpha['o' - 'a'] / 2) * ((alpha['o' - 'a'] + 1) / 2);ll maxi = 0;ll l = alpha['l' - 'a'];for (int i = 2; i < l; i++) {maxi = max(i * (i - 1) / 2 * (l - i), maxi);}num *= maxi;cout << num << endl;return 0;}