# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26147 | 2017-06-28T06:13:03 Z | 조민규(#1100) | None (JOI16_memory2) | C++14 | 0 ms | 1120 KB |
#include "Memory2_lib.h" #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <string> #include <vector> #include <tuple> using namespace std; int ans[100]; int cnt[100]; int mem[100][2]; int pos[50][2]; void Solve(int T, int N){ memset(ans, -1, sizeof(ans)); memset(pos, -1, sizeof(pos)); bool u; int r, p, x, i, j, k; for(i = 0; i<2*N; i++) { u = 1; p = 0; memset(cnt, 0, sizeof(cnt)); for(j = 0; j<2*N; j++) { if(ans[j] != -1 || i == j) continue; r = Flip(i, j); cnt[r]++; if(cnt[r] == 3) break; mem[p][0] = j; mem[p++][1] = r; } if(u) { x = i; for(j = 0; j<p; j++) { ans[mem[j][0]] = mem[j][1]; if(pos[mem[j][1]][0] == -1) pos[mem[j][1]][0] = mem[j][0]; else pos[mem[j][1]][1] = mem[j][0]; } for(j = 0; j<N; j++) { if(pos[j][1] == -1) pos[j][1] = x; Answer(pos[j][0], pos[j][1], j); } return; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 1120 KB | Wrong Answer[3] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 1120 KB | Wrong Answer[3] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 1120 KB | Wrong Answer[3] |
2 | Halted | 0 ms | 0 KB | - |