Submission #148226

# Submission time Handle Problem Language Result Execution time Memory
148226 2019-08-31T18:04:08 Z 조팍시\n123(#3740, tlwpdus, ainta, cki86201) On the Grid (FXCUP4_grid) C++17
12 / 100
3 ms 376 KB
#include "grid.h"
#include<bits/stdc++.h>

using namespace std;

int n;

vector<int> SortDisks(int N) {
    n = N;
    if (N>50) return vector<int>(n,0);
    vector<int> que(n,0), ans(n,0);
    for (int i=0;i<n;i++) {
        int p = 0, t = 0;
        for (int j=0;j<n;j++) {
            if (ans[j]) continue;
            int q = 0;
            for (int k=0;k<n;k++) {
                if (ans[k]) continue;
                que[k]=(q-p+n-i)%(n-i)+1;
                q++;
            }
            vector<int> rq(n,0);
            for (int k=0;k<n;k++) {
                rq[que[k]-1] = k;
            }
            p++;
            int m = PutDisks(rq);
            if (m-n==n-i-1) {
                t = j;
            }
        }
        ans[t] = que[t] = n-i;
    }
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
5 Correct 3 ms 296 KB Output is correct
6 Correct 3 ms 244 KB Output is correct
7 Correct 3 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
5 Correct 3 ms 296 KB Output is correct
6 Correct 3 ms 244 KB Output is correct
7 Correct 3 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
5 Correct 3 ms 296 KB Output is correct
6 Correct 3 ms 244 KB Output is correct
7 Correct 3 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Halted 0 ms 0 KB -