| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 565571 | Abdulmohsen1284 | Xylophone (JOI18_xylophone) | C++14 | 1 ms | 208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class x>
using ordered_set = tree<x, null_type,less<x>, rb_tree_tag,tree_order_statistics_node_update>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//long long a[2000005],up[2000005];
#include "xylophone.h"
static int A[5000];
long long plc[5005],a[5005];
void solve(int N) {
for(int i=2;i<=N;i++)
{
long long chek = query(i,N);
if(chek!=N-1)
{
plc[1]=i-1;
a[i-1]=1;
break;
}
}
long long bef=0;
for(int i=plc[1]+1;i<=N;i++)
{
long long chek = query(plc[1],i);
if(chek!=bef)
{
answer(i,chek+1);
a[i]=chek+1;
plc[chek+1]=i;
}
else
{
long long an = query(plc[chek+1],i);
if(plc[(chek+1)-an]==0)
{
a[i]=(chek+1)-an;
plc[(chek+1)-an]=i;
}
else
{
long long an2 = query(plc[(chek+1)-an],i);
a[i]=((chek+1)-an) + an2;
plc[((chek+1)-an) + an2]=i;
}
}
bef=chek;
}
bef=0;
for(int i=plc[1]-1;i>0;i--)
{
long long chek = query(i,plc[1]);
if(chek!=bef)
{
answer(i,chek+1);
a[i]=chek+1;
plc[chek+1]=i;
}
else
{
long long an = query(i,plc[chek+1]);
if(plc[(chek+1)-an]==0)
{
a[i]=(chek+1)-an;
plc[(chek+1)-an]=i;
answer(i,(chek+1)-an);
}
else
{
long long an2 = query(i,plc[(chek+1)-an]);
a[i]=((chek+1)-an) + an2;
plc[((chek+1)-an) + an2]=i;
answer(i,((chek+1)-an) + an2);
}
}
bef=chek;
}
}컴파일 시 표준 에러 (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... | ||||
