| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 572445 | MohamedFaresNebili | 정렬하기 (IOI15_sorting) | C++14 | 8 ms | 468 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "sorting.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define pb push_back
#define pp pop_back
#define ff first
#define ss second
#define lb lower_bound
#define all(x) (x).begin(), (x).end()
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
for(int l = 0; l < M; l++) {
bool ok = 1;
for(int i = 0; i < N - 1; i++)
if(S[i] > S[i + 1]) {
ok = 0; break;
}
if(ok) return l;
int i = X[l], j = Y[l];
swap(S[i], S[j]);
for(int i = 0; i < N; i++) {
if(S[i] != i) {
P[l] = i; break;
}
}
for(int i = 0; i < N; i++) {
if(S[i] == P[l]) {
Q[l] = i; break;
}
}
swap(S[P[l]], S[Q[l]]);
}
return M;
}
컴파일 시 표준 에러 (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... | ||||
