Submission #148283

#TimeUsernameProblemLanguageResultExecution timeMemory
148283요까할 로뭘 은명팀 1 (#201)Chessboard Nonogram (FXCUP4_nonogram)C++17
25 / 100
6 ms512 KiB
#include "nonogram.h" #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> SolveNonogram(int n, int m, std::vector<std::vector<int>> r, std::vector<std::vector<int>> c) { vector<vector<int> > a(n); vector <int> b; for(int i = 0;i < n;i++) { int k = 0,cn; if(r[i].size() == 0) a[i].push_back(0); if(i % 2 == 0) { for(int j : r[i]) { for(cn = 0;cn < j;k++,cn++) { a[i].push_back(1); } if(k != m) a[i].push_back(0); k++; } } else { b.clear(); for(int j : c[1]) { for(cn = 0;cn < j;k++,cn++) { b.push_back(1); } if(k != n) b.push_back(0); k++; } //for(int j : b) cout << j << " "; //cout << '\n'; if(!b[i]) a[i].push_back(0); k = 0; for(int j : r[i]) { for(cn = 0;cn < j;k++,cn++) { a[i].push_back(1); } if(k != m) a[i].push_back(0); k++; } } } return a; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...