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