# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
147633 | 2019-08-30T10:35:28 Z | 나라는괴물을막아봐(#3642, ainta) | 체스판 네모네모로직 (FXCUP4_nonogram) | C++17 | 7 ms | 640 KB |
#include "nonogram.h" #include<vector> #include<algorithm> using namespace std; std::vector<std::vector<int>> SolveNonogram(int N, int M, std::vector<std::vector<int>> Rclue, std::vector<std::vector<int>> Cclue) { int i, j; vector<vector<int>>w(N); for (i = 0; i < N; i++) { w[i].resize(M); for (j = 0; j < M; j++) { if ((i + j) % 2 == 0)w[i][j] = 1; } } for (i = 0; i < N; i += 2) { vector<int>T = Rclue[i]; int c = 0, pv = 0; for (j = 0; j < M; j++) { if (w[i][j]) { c++; continue; } if (!w[i][j]) { if (pv<T.size() && T[pv] > c) { w[i][j] = 1; c++; } else { c = 0; pv++; } } } } for (i = 0; i < M; i += 2) { vector<int>T = Cclue[i]; int c = 0, pv = 0; for (j = 0; j < N; j++) { if (w[j][i]) { c++; continue; } if (!w[j][i]) { if (pv<T.size() && T[pv] > c) { w[j][i] = 1; c++; } else { c = 0; pv++; } } } } return w; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 512 KB | Output is correct |
2 | Correct | 6 ms | 408 KB | Output is correct |
3 | Correct | 6 ms | 512 KB | Output is correct |
4 | Correct | 6 ms | 512 KB | Output is correct |
5 | Correct | 6 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 512 KB | Output is correct |
2 | Correct | 6 ms | 408 KB | Output is correct |
3 | Correct | 6 ms | 512 KB | Output is correct |
4 | Correct | 6 ms | 512 KB | Output is correct |
5 | Correct | 6 ms | 384 KB | Output is correct |
6 | Correct | 6 ms | 384 KB | Output is correct |
7 | Correct | 6 ms | 384 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 6 ms | 512 KB | Output is correct |
10 | Correct | 6 ms | 512 KB | Output is correct |
11 | Correct | 6 ms | 512 KB | Output is correct |
12 | Correct | 7 ms | 640 KB | Output is correct |
13 | Correct | 3 ms | 512 KB | Output is correct |
14 | Correct | 6 ms | 512 KB | Output is correct |
15 | Correct | 6 ms | 512 KB | Output is correct |