結果
問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
ユーザー |
![]() |
提出日時 | 2018-09-18 13:27:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 366 bytes |
コンパイル時間 | 462 ms |
コンパイル使用メモリ | 63,552 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 07:56:42 |
合計ジャッジ時間 | 1,401 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 15 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/iostream:39, from main.cpp:2: In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>]', inlined from 'int main(int, char**)' at main.cpp:26:13: /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:171:25: warning: 'sum' may be used uninitialized [-Wmaybe-uninitialized] 171 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ main.cpp: In function 'int main(int, char**)': main.cpp:19:14: note: 'sum' was declared here 19 | uint64_t sum; | ^~~
ソースコード
#include <cstdint> #include <iostream> using namespace std; static void setup() { cin.tie(0); ios::sync_with_stdio(false); } int main(int argc, char **argv) { setup(); int n; cin >> n; uint64_t sum; for (auto i = 0; i < n; ++i) { uint64_t a; cin >> a; sum += a; } cout << sum << endl; return 0; }