結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-21 21:28:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 605 bytes |
| コンパイル時間 | 1,869 ms |
| コンパイル使用メモリ | 196,064 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-21 21:28:28 |
| 合計ジャッジ時間 | 3,247 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N,T; cin >> N >> T;
vector<int> A(N-1);
for(auto &t : A) cin >> t;
vector<bool> X(N);
int K; cin >> K;
while(K--){
int p; cin >> p; p -= 2;
X.at(p) = true;
}
int have = 0,answer = 0,idx = 0;
for(auto t : A){
T -= t;
if(T <= 0){
if(have == 0){answer = -1; break;}
have -= 1; answer += 1; T += 10;
}
if(X.at(idx)) have++;
idx++;
}
cout << answer << endl;
}