# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
147936 | 2019-08-31T08:18:54 Z | pichulia,koosaga,ainta(#3658, pichulia) | 체스판 네모네모로직 (FXCUP4_nonogram) | C++17 | 7 ms | 640 KB |
#include "nonogram.h" std::vector<std::vector<int>> SolveNonogram(int n, int m, std::vector<std::vector<int>> Rclue, std::vector<std::vector<int>> Cclue) { std::vector<std::vector<int> > a(n); int i, j, k; for (i = 0; i < n; i++) { a[i].resize(m); for (j = 0; j < m; j++) { if((i&1)^(j&1)) a[i][j] = 0; else a[i][j] = 1; } } // update for (i = 0; i < n; i++) { if (i & 1) { } else { k = 0; int cnt = 0; for (j = 0; j < m; j++) { if (a[i][j] == 1) { cnt++; continue; } if (k < Rclue[i].size() && Rclue[i][k] == cnt) { a[i][j] = 0; k++; cnt = 0; } else { a[i][j] = 1; cnt++; } } } } for (j = 0; j < m; j++) { if (j & 1) { } else { k = 0; int cnt = 0; for (i = 0; i < n; i++) { if (a[i][j] == 1) { cnt++; continue; } if (k < Cclue[j].size() && Cclue[j][k] == cnt) { a[i][j] = 0; k++; cnt = 0; } else { a[i][j] = 1; cnt++; } } } } return a; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 512 KB | Output is correct |
2 | Correct | 6 ms | 384 KB | Output is correct |
3 | Correct | 6 ms | 512 KB | Output is correct |
4 | Correct | 6 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 512 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 512 KB | Output is correct |
2 | Correct | 6 ms | 384 KB | Output is correct |
3 | Correct | 6 ms | 512 KB | Output is correct |
4 | Correct | 6 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 512 KB | Output is correct |
6 | Correct | 6 ms | 512 KB | Output is correct |
7 | Correct | 7 ms | 512 KB | Output is correct |
8 | Correct | 6 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 | 6 ms | 536 KB | Output is correct |
14 | Correct | 6 ms | 512 KB | Output is correct |
15 | Correct | 5 ms | 512 KB | Output is correct |