結果

問題 No.369 足し間違い
ユーザー umaumaxumaumax
提出日時 2017-05-01 21:28:30
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 281 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 58,468 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-12 02:24:01
合計ジャッジ時間 1,126 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, const char**)’:
main.cpp:17:16: warning: ‘sum’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  cout << sum - v << endl;
                ^

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main(int argc, const char* argv[])
{
	int N;
	cin >> N;
	long long int sum;
	for (auto&& a : vector<long long int>(N)) {
		cin >> a;
		sum += a;
	}
	long long int v;
	cin >> v;
	cout << sum - v << endl;
	return 0;
}
0