結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
ゼリトキ
|
| 提出日時 | 2025-03-21 21:58:42 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 961 bytes |
| コンパイル時間 | 3,059 ms |
| コンパイル使用メモリ | 273,540 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-21 21:58:47 |
| 合計ジャッジ時間 | 4,415 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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++)
#define ll long long
#define INF 9e18;
int main(){
cin.tie(0)->sync_with_stdio(0);
cout.tie(0);
ll N,T,K;
cin>>N>>T;
ll t[200009],x[200009];
for(int i=1;i<=N-1;i++) cin>>t[i];
cin>>K;
for(int i=1;i<=K;i++) cin>>x[i];
ll tyokin=0;
ll pos=1;
ll ans=0;
for(int i=1;i<=N-1;i++){
T-=t[i];
if(T<=0){
if(tyokin==0){
cout<<-1<<endl;
return 0;
}
else{
while(T<=0){
T+=10;
tyokin--;
ans++;
if(tyokin<0){
cout<<-1<<endl;
return 0;
}
}
}
}
if(x[pos]==i){
tyokin++;
pos++;
}
}
cout<<ans<<endl;
}
ゼリトキ