# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
484037 | 2021-11-01T23:45:17 Z | Cross_Ratio | 정렬하기 (IOI15_sorting) | C++14 | 1 ms | 460 KB |
#include <bits/stdc++.h> #include "sorting.h" using namespace std; typedef pair<long long int, int> P; vector<P> So; vector<long long int> S; vector<int> X, Y; int N; int findSwapPairs(int N2, int S2[], int M, int X2[], int Y2[], int P1[], int P2[]) { N = N2; int i, j; for(i=0;i<N;i++) { So.push_back(P(S2[i],i)); S.push_back(S2[i]); X.push_back(X2[i]); Y.push_back(Y2[i]); } for(i=0;i<N;i++) { So[i].first = N * So[i].first + i; S[i] = N * S[i] + i; } sort(So.begin(),So.end()); int cnt = 0; for(i=0;i<N;i++) { if(S[i] == So[i].first) continue; P1[cnt] = i; P2[cnt] = So[i].second; swap(S[i],S[So[i].second]); cnt++; } return cnt; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 284 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Incorrect | 0 ms | 204 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 284 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Incorrect | 0 ms | 204 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 284 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Incorrect | 0 ms | 204 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 460 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 460 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |