結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-21 22:32:29 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 865 bytes |
| コンパイル時間 | 3,356 ms |
| コンパイル使用メモリ | 279,576 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-21 22:32:38 |
| 合計ジャッジ時間 | 5,117 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<int> t(n - 1);
long long sum = 0;
for (int i = 0; i < n - 1; i++)
{
cin >> t[i];
}
int k;
cin >> k;
vector<int> x(k);
vector<int> y(n, 0);
for (int i = 0; i < k; i++)
{
cin >> x[i];
y[x[i]] = 1;
}
long long cnt = 0;
queue<int> q;
for (int i = 0; i < n - 1; i++)
{
m -= t[i];
if (y[i] == 1)
{
q.push(i);
}
if (m <= 0)
{
while (!q.empty() && m <= 0)
{
q.pop();
m += 10;
cnt++;
}
if (m <= 0)
{
cout << -1 << endl;
return 0;
}
}
}
cout << cnt << endl;
}