結果

問題 No.73 helloworld
ユーザー kpinkcatkpinkcat
提出日時 2023-10-14 22:06:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 645 bytes
コンパイル時間 994 ms
コンパイル使用メモリ 103,488 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 22:06:52
合計ジャッジ時間 1,690 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
4,352 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:30:18: 警告: ‘maxl’ may be used uninitialized [-Wmaybe-uninitialized]
   30 |     cout << d*e*h*maxl*maxo*r*w << endl;
      |             ~~~~~^~~~~
main.cpp:15:17: 備考: ‘maxl’ はここで定義されています
   15 |     ll d, e, h, maxl, l, o, maxo, r, w, tmp;
      |                 ^~~~

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<math.h>
#include<bitset>
using ll = long long;
using namespace std;

int main(){
    ll d, e, h, maxl, l, o, maxo, r, w, tmp;
    vector<int> alph(26);
    for (int i = 0; i < 26; i++) cin >> alph[i];
    d = alph[3];
    e = alph[4];
    h = alph[7];
    l = alph[11];
    o = alph[14];
    r = alph[17];
    w = alph[22];
    maxo = o/2 * (o - o/2);
    for (int i = 2; i < l; i++){
        tmp = i*(i-1)/2 * (l - i);
        maxl = max(maxl, tmp);
    }
    cout << d*e*h*maxl*maxo*r*w << endl;
}
0