結果
問題 |
No.3067 +10 Seconds Clock
|
ユーザー |
![]() |
提出日時 | 2025-03-21 21:58:08 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 964 bytes |
コンパイル時間 | 3,457 ms |
コンパイル使用メモリ | 272,740 KB |
実行使用メモリ | 6,912 KB |
最終ジャッジ日時 | 2025-03-21 21:58:13 |
合計ジャッジ時間 | 4,818 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge7 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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]; int tyokin=0; int pos=1; int 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; }