結果
| 問題 | No.73 helloworld |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-29 09:21:40 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,029 bytes |
| 記録 | |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 93,056 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-23 02:47:04 |
| 合計ジャッジ時間 | 1,831 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:27:38: warning: 'l' may be used uninitialized [-Wmaybe-uninitialized]
27 | if(d == 0 || e == 0 || h == 0 || l < 3LL || o < 2LL || r == 0 || w == 0){
| ~~^~~~~
main.cpp:15:7: note: 'l' was declared here
15 | L64 l, o, h, e, w, r, d;
| ^
main.cpp:27:49: warning: 'o' may be used uninitialized [-Wmaybe-uninitialized]
27 | if(d == 0 || e == 0 || h == 0 || l < 3LL || o < 2LL || r == 0 || w == 0){
| ~~^~~~~
main.cpp:15:10: note: 'o' was declared here
15 | L64 l, o, h, e, w, r, d;
| ^
main.cpp:27:28: warning: 'h' may be used uninitialized [-Wmaybe-uninitialized]
27 | if(d == 0 || e == 0 || h == 0 || l < 3LL || o < 2LL || r == 0 || w == 0){
| ~~^~~~
main.cpp:15:13: note: 'h' was declared here
15 | L64 l, o, h, e, w, r, d;
| ^
main.cpp:27:18: warning: 'e' may be used uninitialized [-Wmaybe-uninitialized]
27 | if(d == 0 || e == 0 || h == 0 || l < 3LL || o < 2LL || r == 0 || w == 0){
| ~~^~~~
main.cpp:15:16: note: 'e' was declared here
15 | L64 l, o, h, e, w, r, d;
| ^
main.cpp:27:65: warning: 'w' may be used uninitialized [-Wmaybe-uninitialized]
27 | if(d == 0 || e == 0 || h == 0 || l < 3LL || o < 2LL || r == 0 || w == 0){
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
main.cpp:15:19: note: 'w' was declared here
15 | L64 l, o, h, e, w, r, d;
| ^
main.cpp:27:60: warning: 'r' may be used uninitialized [-Wmaybe-uninitialized]
27 | if(d == 0 || e == 0 || h == 0 || l < 3LL || o < 2LL || r == 0 || w == 0){
| ~~^~~~
main.cpp:15:22: note: 'r' was declared here
15 | L64 l, o, h, e, w, r, d;
| ^
main.cpp:27:8: warning: 'd' may be
ソースコード
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <iostream>
#include <iomanip>
#define L64 long long
#define MOD (1000000007LL)
int main(void)
{
L64 l, o, h, e, w, r, d;
for(int i = 1; i <= 26; i++){
L64 a;
std::cin >> a;
if(i == 4) { d = a; }
else if(i == 5) { e = a; }
else if(i == 8) { h = a; }
else if(i == 12) { l = a; }
else if(i == 15) { o = a; }
else if(i == 18) { r = a; }
else if(i == 23) { w = a; }
}
if(d == 0 || e == 0 || h == 0 || l < 3LL || o < 2LL || r == 0 || w == 0){
std::cout << 0 << std::endl;
} else {
L64 ret = d * e * h * r * w;
L64 lmax = 1;
for(L64 i = 0; i <= l - 3LL; i++){
lmax = std::max(lmax, (i + 2LL) * (i + 1LL) / 2LL * (l - 2LL - i));
}
ret *= lmax;
L64 omax = 1;
for(L64 i = 0; i <= o - 2LL; i++){
omax = std::max(omax, (i + 1LL) * (o - 1LL - i));
}
ret *= omax;
std::cout << ret << std::endl;
}
}