結果
問題 |
No.3067 +10 Seconds Clock
|
ユーザー |
![]() |
提出日時 | 2025-03-21 21:51:43 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 550 bytes |
コンパイル時間 | 971 ms |
コンパイル使用メモリ | 85,280 KB |
実行使用メモリ | 5,888 KB |
最終ジャッジ日時 | 2025-03-21 21:51:49 |
合計ジャッジ時間 | 2,881 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 1 |
ソースコード
#include<iostream> #include<vector> using namespace std; int main() { int N;long long T; cin>>N>>T; vector<long long> t(N-1); for(long long &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; } long long req = 1; for(int i=0;i<N-1;++i)req += t[i]; long long times = (req-T+9) / 10; long long 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; }