# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
794906 | 2023-07-27T02:52:12 Z | Username4132 | 정렬하기 (IOI15_sorting) | C++14 | 3 ms | 3412 KB |
#include "sorting.h" #include<iostream> #include<algorithm> using namespace std; #define forn(i, n) for(int i=0; i<(int)n; ++i) #define forsn(i, s, n) for(int i=s; i<(int)n; ++i) const int MAXN = 610; int n, cou, arr[MAXN][MAXN]; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { n=N; forn(i, n) arr[0][i]=S[i]; forn(i, n-1){ forn(j, n) arr[i+1][j]=arr[i][j]; swap(arr[i+1][X[i]], arr[i+1][Y[i]]); } forn(i, n-1){ int num = arr[n-1][i]; forsn(j, i+1, n){ int x = find(arr[j], arr[j]+n, num) - arr[j]; int y = find(arr[j], arr[j]+n, i) - arr[j]; swap(arr[j][x], arr[j][y]); if(j==i+1 && x!=y) P[cou]=x, Q[cou]=y, ++cou; } } P[cou]=Q[cou]=0; return cou+1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Incorrect | 1 ms | 212 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Incorrect | 1 ms | 212 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Incorrect | 1 ms | 212 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 3412 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 3412 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |