結果

問題 No.3067 +10 Seconds Clock
コンテスト
ユーザー kenti
提出日時 2025-03-23 11:21:01
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 758 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,592 ms
コンパイル使用メモリ 340,672 KB
実行使用メモリ 13,440 KB
最終ジャッジ日時 2026-11-11 04:56:30
合計ジャッジ時間 4,841 ms
ジャッジサーバーID
(参考情報)
judge7_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    int N, T; cin >> N >> T;
    vector<int> t(N - 1);
    for (int i = 0; i < N - 1; i++) cin >> t[i];
    int K; cin >> K;
    set<int> x;
    for (int i = 0; i < K; i++) {
        int tmp; cin >> tmp;
        x.insert(tmp);
    }
    int ts = 0;
    for (int i = 0; i < N - 1; i++) {
        ts += t[i];
    }
    int ans = max(0, (ts - T) / 10 + 1);
    for (int i = 0; i < N - 1; i++) {
        T -= t[i];
        if (T <= 0) {
            cout << -1 << "\n";
            return 0;
        }
        if (T > 0 && x.contains(i + 2)) {
            T += 10;
        }
    }
    cout << ans << "\n";
    return 0;
}
0