| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 932356 | 12345678 | Martian DNA (BOI18_dna) | C++17 | 2028 ms | 3204 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int nx=2e5+5;
int n, v[nx], k, r, res[nx], b, q, ans=INT_MAX;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>k>>r;
for (int i=1; i<=n; i++) cin>>v[i], res[i]=INT_MAX;
for (int i=1; i<=r; i++)
{
cin>>b>>q;
deque<int> dq;
for (int j=1; j<=n; j++)
{
if (v[j]==b) dq.push_back(j);
while (!dq.empty()&&dq.size()>q) dq.pop_front();
if (dq.size()>=q) res[j]=min(res[j], dq.front());
else res[j]=-1;
//cout<<i<<' '<<j<<' '<<res[j]<<'\n';
}
}
for (int i=1; i<=n; i++) ans=min(ans, res[i]!=-1?i-res[i]+1:INT_MAX);
if (ans==INT_MAX) cout<<"impossible";
else cout<<ans;
}컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
