| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 100611 | luciocf | Sorting (IOI15_sorting) | C++14 | 2 ms | 480 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "sorting.h"
using namespace std;
const int maxn = 2e5+10;
int pos[maxn];
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[])
{
for (int i = 0; i < N; i++) pos[S[i]] = i;
if (Y[0] == 0)
{
for (int i = 0; i < N; i++)
{
int j = S[i];
P[i] = pos[i], Q[i] = i;
S[pos[i]] = j, S[i] = i;
pos[j] = pos[i], pos[i] = i;
}
return N;
}
pos[S[0]] = 1, pos[S[1]] = 0;
swap(S[0], S[1]);
int j = S[1];
P[0] = pos[0], Q[0] = 1;
S[pos[0]] = j, S[1] = 0;
pos[j] = pos[0], pos[0] = 1;
pos[S[0]] = 1, pos[S[1]] = 0;
swap(S[0], S[1]);
j = S[1];
P[1] = pos[1], Q[1] = 1;
S[pos[1]] = j, S[1] = 1;
pos[j] = pos[1], pos[1] = 1;
for (int i = 2; i < N; i++)
{
j = S[i];
P[i] = pos[i], Q[i] = i;
S[pos[i]] = j, S[i] = i;
pos[j] = pos[i], pos[i] = i;
}
if (N&1)
{
P[N] = 0, Q[N] = 0;
return N+1;
}
return N;
}
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
