답안 #527213

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
527213 2022-02-17T03:40:55 Z joelau On the Grid (FXCUP4_grid) C++17
12 / 100
2 ms 296 KB
#include "grid.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<int> SortDisks(int N) {
    vector<int> v;
    for (int i = 0; i < N; ++i) v.push_back(i);
    for (int i = 0; i < N; ++i) {
        pair<int,int> most = make_pair(0,0);
        for (int j = 0; j < N-i; ++j) {
            swap(v[0],v[j]);
            most = max(most,make_pair(PutDisks(v),j));
            swap(v[0],v[j]);
        }
        swap(v[most.second],v[N-i-1]);
    }
    vector<int> ans(N);
    for (int i = 0; i < N; ++i) ans[v[i]] = i+1;
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Incorrect 2 ms 204 KB Output isn't correct
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Incorrect 2 ms 204 KB Output isn't correct
10 Halted 0 ms 0 KB -