| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 458060 | ZaZo_ | Martian DNA (BOI18_dna) | C++14 | 673 ms | 19524 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Sorry but iam targeting IOI :))
//NEVER LOSE HOPE
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
#define endl "\n"
#define ceil(a,b) (a+(b-1))/b
#define all(v) v.begin(),v.end()
#define int long long int
#define Hidden ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N=3e4+10,mod = 1e9+7;
int32_t main(){
int n,k,rr;
cin>>n>>k>>rr;
int arr[n];
map<int,int>mp,req,dif;
set<int>st;
for(int i = 0 ; i < n ; i ++)
{
cin>>arr[i];
}
int flg=0;
for(int i = 0 ; i < rr ; i ++)
{
int x,y;
cin>>x>>y;
req[x]=y;
}
int l=0,r=0,ans=INT_MAX,cnt=0;
while(l<=r)
{
while(r<n && (r<k || cnt<req.size()) )
{
mp[arr[r]]++;
if(req.count(arr[r]) && mp[arr[r]]==req[arr[r]]) cnt++;
r++;
}
if(cnt==req.size()) ans=min(ans,r-l);
mp[arr[l]]--;
if(req.count(arr[l])&&req[arr[l]]>mp[arr[l]]) cnt--;
l++;
}
if(ans==INT_MAX)
{
cout<<"impossible"<<endl;
return 0;
}
cout<<ans<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
