Submission #148947

# Submission time Handle Problem Language Result Execution time Memory
148947 2019-09-01T05:26:14 Z USA1(#3634, ecnerwala, scott_wu, ksun48) On the Grid (FXCUP4_grid) C++17
12 / 100
6 ms 384 KB
#include "grid.h"
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 1100;

int N;
vector <int> cv;

vector<int> SortDisks(int __N) {
    N = __N;
    for (int i = 0; i < N; i++)
        cv.push_back(i);

    for (int i = N - 1; i > 0; i--)
    {
        for (int j = 0; j <= i; j++)
        {
            if (j > 0)
                swap (cv[j], cv[0]);
            if (PutDisks (cv) == N + i)
            {
                swap (cv[0], cv[i]);
                break;
            }
        }
    }

    vector <int> res;
    for (int i = 0; i < N; i++)
        res.push_back(0);
    for (int i = 0; i < N; i++)
        res[cv[i]] = i + 1;
    return res;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Incorrect 6 ms 256 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Incorrect 6 ms 256 KB Output isn't correct
10 Halted 0 ms 0 KB -