結果
| 問題 | No.73 helloworld |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-12 03:43:23 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 725 bytes |
| 記録 | |
| コンパイル時間 | 489 ms |
| コンパイル使用メモリ | 80,868 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-09 11:40:44 |
| 合計ジャッジ時間 | 1,537 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#include <iostream>
#include <string>
using lint = long long;
const std::string one = "hewrd";
void solve() {
lint ans = 1;
for (char c = 'a'; c <= 'z'; ++c) {
lint x;
std::cin >> x;
for (auto d : one) {
if (c == d) ans *= x;
}
if (c == 'o') {
ans *= (x / 2) * (x - x / 2);
}
if (c == 'l') {
lint max = 0;
for (int k = 0; k <= x; ++k) {
max = std::max(max, (x - k) * (x - k - 1) * k / 2);
}
ans *= max;
}
}
std::cout << ans << std::endl;
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}