# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
921752 | 2024-02-04T09:50:20 Z | coding_snorlax | 정렬하기 (IOI15_sorting) | C++14 | 5 ms | 348 KB |
#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[]) { for(int i=2;i<N;i++){ int tmp = S[X[i-2]]; S[X[i-2]]=S[Y[i-2]]; S[Y[i-2]]=tmp; for(int j=0;j<N;j++){ if(S[j]==i){ P[i-2]=j; Q[i-2]=i; S[j]=S[i]; S[i]=i; break; } } // check already_sorted int flag = 1; for(int j=0;j<N;j++){ if(S[j]!=j) flag =0; } if(flag){ return i-1; } } int tmp = S[X[N-2]]; S[X[N-2]]=S[Y[N-2]]; S[Y[N-2]]=tmp; if(S[0]!=0){P[N-2]=0;Q[N-2]=1;} else {P[N-2]=0;Q[N-2]=0;} return N-1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Incorrect | 1 ms | 344 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Incorrect | 1 ms | 344 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Incorrect | 1 ms | 344 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |