結果
問題 | No.73 helloworld |
ユーザー | Pachicobue |
提出日時 | 2017-07-20 19:15:59 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,173 bytes |
コンパイル時間 | 1,749 ms |
コンパイル使用メモリ | 165,432 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-12 13:28:24 |
合計ジャッジ時間 | 2,515 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | AC | 2 ms
4,376 KB |
testcase_07 | AC | 1 ms
4,376 KB |
testcase_08 | AC | 2 ms
4,380 KB |
testcase_09 | AC | 1 ms
4,376 KB |
testcase_10 | AC | 1 ms
4,384 KB |
testcase_11 | AC | 2 ms
4,376 KB |
testcase_12 | AC | 1 ms
4,376 KB |
testcase_13 | AC | 1 ms
4,376 KB |
ソースコード
#include <bits/stdc++.h> #define show(x) cout << #x << " = " << x << endl using 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; }