結果

問題 No.369 足し間違い
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2016-05-12 21:07:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 778 bytes
コンパイル時間 1,842 ms
コンパイル使用メモリ 162,044 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 07:57:31
合計ジャッジ時間 2,084 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;

const int MAX_N = 10000;
const int MAX_A = 10000;

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int N;
    cin >> N;
    assert(1 <= N && N <= MAX_N);
    int sm = 0;
    rep(i, N) {
        int x;
        cin >> x;
        assert(-MAX_A <= x && x <= MAX_A);
        sm += x;
    }

    int v;
    cin >> v;
    assert(-1e9 <= v && v <= 1e9);
    cout << sm - v << endl;

}
0