結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
とんぼ
|
| 提出日時 | 2025-03-21 21:31:56 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 101 ms / 2,000 ms |
| コード長 | 686 bytes |
| コンパイル時間 | 3,334 ms |
| コンパイル使用メモリ | 273,020 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2025-03-21 21:32:02 |
| 合計ジャッジ時間 | 4,493 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
#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+1])have++;
}
if(ans==0)ans=-1;
else{
ans=0;
while(now<=0){
ans++;
now+=10;
}
}
cout<<ans<<endl;
return 0;
}
とんぼ