結果

問題 No.73 helloworld
コンテスト
ユーザー kpinkcat
提出日時 2023-10-14 22:06:50
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 645 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 670 ms
コンパイル使用メモリ 128,772 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-07-02 16:01:09
合計ジャッジ時間 1,624 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/string:53,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/locale_classes.h:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ios_base.h:43,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ios:46,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ostream.h:43,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ostream:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/iostream:43,
                 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:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algobase.h:263:7: warning: 'maxl' may be used uninitialized [-Wmaybe-uninitialized]
  263 |       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 #
raw source code

#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