結果

問題 No.3678 しゃべりすぎた男
コンテスト
ユーザー 抹茶フォルマッジ
提出日時 2026-09-05 13:25:32
言語 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
+ 365µs
コード長 2,263 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,964 ms
コンパイル使用メモリ 387,260 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-05 13:25:40
合計ジャッジ時間 6,933 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

using ll = long long;
using ull = unsigned long long;
using ld = long double;

using mint = modint998244353;
// using mint = modint1000000007;

constexpr ll INF = (1LL << 60);
constexpr int INF32 = (1 << 30);

template<typename T> using vc = vector<T>;
template<typename T> using vv = vector<vector<T>>;

using vi = vc<int>;
using vvi = vv<int>;
using vl = vc<ll>;
using vvl = vv<ll>;
using vs = vc<string>;
using vvs = vv<string>;
using vb = vc<bool>;
using vvb = vv<bool>;
using vmint = vc<mint>;
using vvmint = vv<mint>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

#define rep(i,n) for(ll i=0; i<(ll)(n); i++)
#define drep(i,n) for(ll i=(ll)(n)-1; i>=0; i--)
#define rrep(i,n) for(ll i=1; i<=(ll)(n); i++)
#define nfor(i,a,b) for(ll i=(ll)(a); i<(ll)(b); i++)
#define dfor(i,a,b) for(ll i=(ll)(a)-1; i>=(ll)(b); i--)

#define nall(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

template<class T>
istream& operator>>(istream& is, vector<T>& v) {
    for (auto& x : v) is >> x;
    return is;
}

template<class T, class U>
istream& operator>>(istream& is, pair<T,U>& p) {
    return is >> p.first >> p.second;
}

template<class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

void YES() { cout << "Yes\n"; }
void NO()  { cout << "No\n"; }

void yn(bool ok) {
    cout << (ok ? "Yes" : "No") << '\n';
}

template<class T>
void print(const vector<T>& v) {
    for (int i = 0; i < (int)v.size(); i++) {
        if (i) cout << ' ';
        cout << v[i];
    }
    cout << '\n';
}

template<class T>
void print(const vector<vector<T>>& v) {
    for (const auto& row : v) {
        print(row);
    }
}

void print(ld x) {
    cout << fixed << setprecision(20) << x << '\n';
}

int main() {
    vi T(7);
    cin >> T;
    int sum = 0;
    vi ans(7,-1);
    rep(i,7) {
        if(T[i]==-1) {
            break;
        }
        sum += T[i];
        if(sum<=6000) ans[i] = 6000 - sum;
        else break;
    }
    rep(i,7) cout << ans[i] << "\n";
}
0