結果

問題 No.3067 +10 Seconds Clock
ユーザー friedrice
提出日時 2025-02-06 22:05:48
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 3,384 ms
コンパイル使用メモリ 276,068 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-20 11:10:41
合計ジャッジ時間 4,583 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
  int N, T, K;
  cin >> N >> T;
  vector<int> t(N - 1, 0), sum(N, 0);
  for(int i = 0; i < N - 1; i++) {
    cin >> t[i];
    sum[i + 1] = sum[i] + t[i];
  }
  cin >> K;
  vector<int> x(K, 0);
  for(int &o : x) {
    cin >> o, o--;
  }
  for(int i = 0; i < K; i++) {
    if(T + 10 * i <= sum[x[i]]) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << max((sum[N - 1] - T) / 10, -1) + 1 << endl;
}
0