Submission #328547

#TimeUsernameProblemLanguageResultExecution timeMemory
328547seedkinOn the Grid (FXCUP4_grid)C++17
0 / 100
1 ms364 KiB
#include "grid.h" int candi[1005][1005]; std::vector<int> SortDisks(int N) { std::vector<int> disks; // i번째로 넣을 막대,(막대 번호) std::vector<int> ans; // i번째 막대의 길이, a[i] = N // int result; disks.resize(N); ans.resize(N); int maxV = 2 * N - 1; int mod = N; for (int i = 0; i <= N; i++) { for (int j = 0; j <= N; j++) { candi[i][j] = 1; } } for (int i = 0; i < N; i++) { disks[i] = i; } for (int i = 0; i < 2 * N; i++) { int result = PutDisks(disks); if (result == N) { for (int j = 0; j < N; j++) { ans[disks[j]] = j + 1; } break; } if (result == maxV) { ans[disks[0]] = mod; int temp = disks[0]; disks[0] = disks[mod - 1]; disks[mod - 1] = temp; mod--; maxV--; } // for(int j = 0; j < N; j++ ) { // for(int l = N - diff - j - 1; l >=0; l--) { // candi[disks[l]][N-j] = 0; // } // } int temp = disks[0]; for (int j = 0; j < mod-1; j++) { disks[j] = disks[j + 1]; } disks[mod - 1] = temp; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...