結果
| 問題 | No.3067 +10 Seconds Clock |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2025-03-22 10:37:23 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 562 bytes |
| 記録 | |
| コンパイル時間 | 870 ms |
| コンパイル使用メモリ | 184,616 KB |
| 実行使用メモリ | 9,268 KB |
| 最終ジャッジ日時 | 2026-07-07 19:41:13 |
| 合計ジャッジ時間 | 2,777 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)
int main() {
int N, T, K;
cin >> N >> T;
vector<int> t(N - 1);
rep(i, N - 1) cin >> t[i];
cin >> K;
vector<int> x(N);
rep(i, K) {
int a;
cin >> a;
x[a - 1] = 1;
}
int now = T, ans = 0, cnt = 0;
rep(i, N - 1) {
now -= t[i];
if(now <= 0) {
while(cnt && now <= 0) {
now += 10;
ans++;
cnt--;
}
if(now <= 0) {
cout << -1 << endl;
return 0;
}
}
if(x[i]) {
cnt++;
}
}
cout << ans << endl;
}
forest3