結果
問題 | No.73 helloworld |
ユーザー | ふーらくたる |
提出日時 | 2016-08-13 04:53:26 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 841 bytes |
コンパイル時間 | 629 ms |
コンパイル使用メモリ | 55,000 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 16:19:56 |
合計ジャッジ時間 | 1,172 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,248 KB |
testcase_03 | WA | - |
testcase_04 | AC | 2 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 2 ms
5,248 KB |
testcase_08 | AC | 1 ms
5,248 KB |
testcase_09 | AC | 2 ms
5,248 KB |
testcase_10 | AC | 1 ms
5,248 KB |
testcase_11 | AC | 1 ms
5,248 KB |
testcase_12 | WA | - |
testcase_13 | AC | 1 ms
5,248 KB |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:27:51: warning: ‘d’ may be used uninitialized in this function [-Wmaybe-uninitialized] 27 | ll temp_res = h * e * func_for_o(o) * w * r * d, | ^ main.cpp:27:45: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] 27 | ll temp_res = h * e * func_for_o(o) * w * r * d, | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ main.cpp:27:41: warning: ‘w’ may be used uninitialized in this function [-Wmaybe-uninitialized] 27 | ll temp_res = h * e * func_for_o(o) * w * r * d, | ~~~~~~~~~~~~~~~~~~~~~~^~~ main.cpp:11:17: warning: ‘o’ may be used uninitialized in this function [-Wmaybe-uninitialized] 11 | ll h, e, l, o, w, r, d; | ^ main.cpp:30:32: warning: ‘l’ may be used uninitialized in this function [-Wmaybe-uninitialized] 30 | for (ll left_l = 2; left_l <= l - 1; left_l++) { | ~~~~~~~^~~~~~~~ main.cpp:27:21: warning: ‘e’ may be used uninitialized in this function [-Wmaybe-uninitialized] 27 | ll temp_res = h * e * func_for_o(o) * w * r * d, | ~~^~~ main.cpp:27:21: warning: ‘h’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ソースコード
#include <iostream> using namespace std; typedef long long ll; ll func_for_o(ll o_cnt) { return o_cnt / 2 * (o_cnt - o_cnt / 2); } int main() { ll h, e, l, o, w, r, d; for (int i = 0; i < 26; i++) { ll c; cin >> c; switch ('a' + i) { case 'h': h = c; break; case 'e': e = c; break; case 'l': l = c; break; case 'o': o = c; break; case 'w': w = c; break; case 'r': r = c; break; case 'd': d = c; break; default: break; } } ll temp_res = h * e * func_for_o(o) * w * r * d, res = temp_res; // l だけ全探索 for (ll left_l = 2; left_l <= l - 1; left_l++) { ll temp = left_l * (left_l - 1) / 2 * (l - left_l); res = max(res, temp_res * temp); } cout << res << endl; return 0; }