結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-21 21:35:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 814 bytes |
| コンパイル時間 | 2,082 ms |
| コンパイル使用メモリ | 193,032 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-21 21:35:59 |
| 合計ジャッジ時間 | 3,353 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
bool chk[200005];
int n,m,k,x;
int t[200005];
int main(void)
{
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n >> m;
for(int i=1;i<n;i++) cin >> t[i];
cin >> k;
for(int i=0;i<k;i++)
{
cin >> x;
chk[x] = true;
}
int res = 0;
int cnt = 0;
for(int i=1;i<n;i++)
{
if(m <= t[i])
{
int x = ceil((t[i] - m)*1.0/10);
if(m==t[i]) x = 1;
if(cnt < x)
{
res = -1;
break;
}
res += x;
cnt-=x;
m += (10*x);
m -= t[i];
}
else
{
m -= t[i];
if(chk[i+1]) cnt+=1;
}
}
cout << res << '\n';
return 0;
}