結果

問題 No.1822 Keima of Shogi
ユーザー mudbdb
提出日時 2022-01-28 22:31:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 169 bytes
コンパイル時間 656 ms
コンパイル使用メモリ 63,104 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 08:32:35
合計ジャッジ時間 1,564 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/iostream:39,
                 from main.cpp:1:
In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]',
    inlined from 'int main()' at main.cpp:9:18:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:202:25: warning: 'a' may be used uninitialized [-Wmaybe-uninitialized]
  202 |       { return _M_insert(__n); }
      |                ~~~~~~~~~^~~~~
main.cpp: In function 'int main()':
main.cpp:7:19: note: 'a' was declared here
    7 |     long long int a;
      |                   ^

ソースコード

diff #

#include <iostream>
int main() {
    int n;
    std::cin >> n;
    n = n/3;
    int k;
    long long int a;
    for (k=0; k<=n; k++) a = a + k + 1;
    std::cout << a;
}
0