結果
問題 | No.73 helloworld |
ユーザー | 👑 obakyan |
提出日時 | 2019-04-29 09:21:40 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,029 bytes |
コンパイル時間 | 839 ms |
コンパイル使用メモリ | 72,640 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 23:18:58 |
合計ジャッジ時間 | 1,178 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 2 ms
5,376 KB |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:30:17: warning: ‘d’ may be used uninitialized in this function [-Wmaybe-uninitialized] 30 | L64 ret = d * e * h * r * w; | ~~^~~ main.cpp:30:25: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] 30 | L64 ret = d * e * h * r * w; | ~~~~~~~~~~^~~ main.cpp:30:9: warning: ‘w’ may be used uninitialized in this function [-Wmaybe-uninitialized] 30 | L64 ret = d * e * h * r * w; | ^~~ main.cpp:30:17: warning: ‘e’ may be used uninitialized in this function [-Wmaybe-uninitialized] 30 | L64 ret = d * e * h * r * w; | ~~^~~ main.cpp:30:21: warning: ‘h’ may be used uninitialized in this function [-Wmaybe-uninitialized] 30 | L64 ret = d * e * h * r * w; | ~~~~~~^~~ main.cpp:15:10: warning: ‘o’ may be used uninitialized in this function [-Wmaybe-uninitialized] 15 | L64 l, o, h, e, w, r, d; | ^ main.cpp:15:7: warning: ‘l’ may be used uninitialized in this function [-Wmaybe-uninitialized] 15 | L64 l, o, h, e, w, r, d; | ^
ソースコード
#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; } }