結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
Ponzu
|
| 提出日時 | 2025-03-21 21:46:25 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 506 bytes |
| コンパイル時間 | 1,155 ms |
| コンパイル使用メモリ | 85,532 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-21 21:46:31 |
| 合計ジャッジ時間 | 4,620 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 1 RE * 16 |
ソースコード
#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[K];
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