結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
tobbie
|
| 提出日時 | 2025-04-07 18:26:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 598 bytes |
| コンパイル時間 | 2,357 ms |
| コンパイル使用メモリ | 195,000 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-04-07 18:27:00 |
| 合計ジャッジ時間 | 5,247 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
int main() {
int n, t;
cin >> n >> t;
vector<int> ti(n-1), xi(n - 1, 0);
rep(i, n-1) cin >> ti[i];
int k;
cin >> k;
rep(i, k) {
int x; cin >> x;
xi[x-1] = 10;
}
t -= ti[0];
int cnt = 0;
int res = 0;
rep(i, n-2) {
res += xi[i];
if (t - ti[i+1] <= 0) {
while (res > 0 && t <= ti[i+1]) {
t += 10;
cnt++;
res -= 10;
}
}
t -= ti[i+1];
if (t < 0) {
cout << -1 << endl;
return 0;
}
}
cout << cnt << endl;
return 0;
}
tobbie