結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー htaniguchi88
提出日時 2019-05-20 21:42:15
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 60,032 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-17 06:43:40
合計ジャッジ時間 5,830 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 9 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main() {

    int x;
    vector<int> v;
    int sum = 0;

    cin >> x;

    v.resize(x);

    for (int i=0;i<=x-1;i++) {
        cin >> v[i];
        cout << " ";
    };

    for (size_t t=0; t < v.size() ; t++) {
        sum += v[t];
    };
    
    cout << sum << endl;

    return 0;
}
0