結果
問題 |
No.3067 +10 Seconds Clock
|
ユーザー |
![]() |
提出日時 | 2025-03-21 22:01:09 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 980 bytes |
コンパイル時間 | 3,785 ms |
コンパイル使用メモリ | 272,812 KB |
実行使用メモリ | 6,784 KB |
最終ジャッジ日時 | 2025-03-21 22:01:15 |
合計ジャッジ時間 | 4,614 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 && T<=0){ cout<<-1<<endl; return 0; } } } } if(pos<=K && x[pos]==i){ tyokin++; pos++; } } cout<<ans<<endl; }