結果
問題 |
No.3067 +10 Seconds Clock
|
ユーザー |
![]() |
提出日時 | 2025-03-21 21:29:48 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 685 bytes |
コンパイル時間 | 3,148 ms |
コンパイル使用メモリ | 273,060 KB |
実行使用メモリ | 5,888 KB |
最終ジャッジ日時 | 2025-03-21 21:29:55 |
合計ジャッジ時間 | 4,620 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 1 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,N) for(i=0;i<N;i++) #define ll long long int main(void){ ll N,T; ll t[200009]={0}; bool tokei[200009]={0}; ll K; ll i,j,k; cin>>N>>T; rep(i,N-1)cin>>t[i+1]; cin>>K; rep(i,K){ cin>>j; tokei[j]=1; } ll now=T; ll have=0; ll ans=1; for(i=1;i<N;i++){ if(now-t[i]+10*have<=0){ ans=0; break; } now-=t[i]; if(tokei[i])have++; } if(ans==0)ans=-1; else{ ans=0; while(now<=0){ ans++; now+=10; } } cout<<ans<<endl; return 0; }