Submission #554719

# Submission time Handle Problem Language Result Execution time Memory
554719 2022-04-29T09:32:29 Z slime Vision Program (IOI19_vision) C++14
0 / 100
12 ms 1128 KB
#include <bits/stdc++.h>

#include "vision.h"

void construct_network(int H, int W, int K) {
  if(K == 1 && std::min(H, W) == 1 && std::max(H, W) == 2) {
    std::vector<int> all = {0, 1};
    add_or(all);
    return;
  }
	std::vector<int> Ns;
  std::vector<int> rows, cols;
  for(int i=0; i<H; i++) {
    Ns.clear();
    for(int j=0; j<W; j++) {
      Ns.push_back(i*W + j);
    }
    rows.push_back(add_or(Ns));
  }
  for(int i=0; i<W; i++) {
    Ns.clear();
    for(int j=0; j<H; j++) {
      Ns.push_back(j*W + i);
    }
    cols.push_back(add_or(Ns));
  }
  std::vector<int> analyze;
  int cntrows = add_xor(rows);
  int cntcols = add_xor(cols);
  std::vector<int> rows_adj, cols_adj;
  for(int i=1; i<rows.size(); i++) {
    Ns.clear();
    Ns = {rows[i-1], rows[i]};
    rows_adj.push_back(add_and(Ns));
  }
  for(int i=1; i<cols.size(); i++) {
    Ns.clear();
    Ns = {cols[i-1], cols[i]};
    cols_adj.push_back(add_and(Ns));
  }
  Ns.clear();
  Ns = {cntrows, add_xor(cols_adj)};
  analyze.push_back(add_and(Ns));
  Ns.clear();
  Ns = {cntcols, add_xor(rows_adj)};
  analyze.push_back(add_and(Ns));
  add_or(analyze);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:31:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |   for(int i=1; i<rows.size(); i++) {
      |                ~^~~~~~~~~~~~
vision.cpp:36:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |   for(int i=1; i<cols.size(); i++) {
      |                ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1128 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -