結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
Ponzu
|
| 提出日時 | 2025-03-21 21:49:34 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 510 bytes |
| コンパイル時間 | 785 ms |
| コンパイル使用メモリ | 85,280 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2025-03-21 21:49:42 |
| 合計ジャッジ時間 | 2,630 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge7 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 1 |
ソースコード
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int N,T;
cin>>N>>T;
vector<int> t(N-1);
for(int &i:t)cin>>i;
int K;
cin>>K;
bool k[1<<18];
for(int i=0;i<K;++i)
{
int num;
cin>>num;
k[num-1] = true;
}
int req = 1;
for(int i=0;i<N-1;++i)req += t[i];
int times = (req-T+9) / 10;
int ans = times;
if(req < T) ans = 0;
for(int i=0;i<N-1;++i)
{
T -= t[i];
if(T<=0)
{
cout << -1 << endl;
return 0;
}
if(k[i] && times--)T+=10;
}
cout << ans << endl;
}
Ponzu