結果

問題 No.3678 しゃべりすぎた男
コンテスト
ユーザー Uzawa_Reisa
提出日時 2026-09-05 16:23:39
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.92.0)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 462µs
コード長 950 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,390 ms
コンパイル使用メモリ 306,148 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-05 16:23:47
合計ジャッジ時間 7,016 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <climits>
#include <chrono>
#include <atcoder/all>

using namespace std;

/*

*/

int main(){
    int N = 7;
    vector<int> T(N);
    for (int i = 0; i < N; i++){
        cin >> T[i];
    }
    bool flag = false;
    int sm = 0;
    for (int i = 0; i < N; i++){
        if (flag){
            cout << -1 << "\n";
        }
        else {
            if (T[i] == -1){
                flag = true;
                cout << -1 << "\n";
            }
            else {
                sm += T[i];
                if (sm > 6000){
                    cout << -1 << "\n";
                    flag = true;
                }
                else {
                    cout << 6000 - sm << "\n";
                }
            }
        }
    }
    return 0;
}
0