結果

問題 No.369 足し間違い
ユーザー data9824data9824
提出日時 2016-06-01 23:59:28
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 716 ms
コンパイル使用メモリ 59,940 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 05:12:26
合計ジャッジ時間 1,221 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	int v;
	cin >> v;
	int sum = accumulate(a.begin(), a.end(), 0);
	cout << (sum - v) << endl;
	return 0;
}
0