# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
448312 | MOUF_MAHMALAT | Tenis (COI19_tenis) | C++14 | 86 ms | 6436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define all(s) s.begin(),s.end()
using namespace std;
typedef int ll;
ll n,q,a[100009][4],id[100009][4],t,op[4],x,y,z;
queue<ll>dq;
bool b[100009];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
scanf("%d%d",&n,&q);
for(ll j=1; j<=3; j++)
for(ll i=1; i<=n; i++)
{
scanf("%d",&a[i][j]);
id[a[i][j]][j]=i;
}
for(ll j=1; j<=3; j++)
dq.push(a[1][j]),b[a[1][j]]=1;
while(!dq.empty())
{
t=dq.front();
dq.pop();
for(ll j=1; j<=3; j++)
{
for(ll i=op[j]+1; i<id[t][j]; i++)
{
dq.push(a[i][j]);
b[a[i][j]]=1;
}
op[j]=max(op[j],id[t][j]);
}
}
while(q--)
{
scanf("%d%d",&t,&x);
if(b[x]==0)
printf("NE\n");
else
printf("DA\n");
}
return 0;
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |