結果

問題 No.3678 しゃべりすぎた男
コンテスト
ユーザー bolero
提出日時 2026-09-05 13:04:47
言語 C++23
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,307 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,023 ms
コンパイル使用メモリ 374,752 KB
実行使用メモリ 9,736 KB
最終ジャッジ日時 2026-09-05 13:05:38
合計ジャッジ時間 6,100 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#if __has_include(<pch/all.h>)
#include <pch/all.h>
#else
#include <bits/stdc++.h>
#include <atcoder/all>
#endif

using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No")
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort(v.rbegin(), v.rend())
#define REVERSE(v) reverse(v.begin(), v.end())

template <typename Container>
void printVector(const Container &v, char delimiter = ' ')
{
    for (auto itr = v.begin(); itr != v.end(); itr++)
    {
        if (itr != v.begin())
        {
            cout << delimiter;
        }
        cout << *itr;
    }
    cout << endl;
}

template <typename Container>
void printlnVector(const Container &v)
{
    printVector(v, '\n');
}

void solve()
{
    int N = 7;
    vector<int> T(N);
    rep(i, N)
    {
        cin >> T[i];
        if (T[i] == -1)
        {
            T[i] = INT32_MAX;
        }
    }

    // SORT(T);
    long long ans = 6000;

    rep(i, N)
    {
        if (T[i] == INT32_MAX)
        {
            cout << -1 << endl;
            continue;
        }

        ans -= T[i];
        ans = max(ans, -1ll);

        cout << ans << endl;
    }
}

int main()
{
    int T = 1;
    // cin >> T;

    while (T--)
    {
        solve();
    }

    return 0;
}
0