結果

問題 No.73 helloworld
ユーザー kpinkcat
提出日時 2023-10-14 22:06:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 645 bytes
コンパイル時間 768 ms
コンパイル使用メモリ 104,368 KB
最終ジャッジ日時 2025-02-17 07:49:46
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from /usr/include/c++/13/string:51,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from main.cpp:1:
In function ‘constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = long long int]’,
    inlined from ‘int main()’ at main.cpp:28:19:
/usr/include/c++/13/bits/stl_algobase.h:262:7: warning: ‘maxl’ may be used uninitialized [-Wmaybe-uninitialized]
  262 |       if (__a < __b)
      |       ^~
main.cpp: In function ‘int main()’:
main.cpp:15:17: note: ‘maxl’ was declared here
   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