Submission #554720

# Submission time Handle Problem Language Result Execution time Memory
554720 2022-04-29T09:34:06 Z slime Vision Program (IOI19_vision) C++14
14 / 100
10 ms 1072 KB
#include<bits/stdc++.h>
#include "vision.h"
void construct_network(int H, int W, int K) {
	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();
  if(cols_adj.size()) Ns = {cntrows, add_xor(cols_adj)};
  else Ns = {cntrows};
  analyze.push_back(add_and(Ns));
  Ns.clear();
  if(rows_adj.size()) Ns = {cntcols, add_xor(rows_adj)};
  else Ns = {cntcols};
  analyze.push_back(add_and(Ns));
  add_or(analyze);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:24:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   for(int i=1; i<rows.size(); i++) {
      |                ~^~~~~~~~~~~~
vision.cpp:29:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |   for(int i=1; i<cols.size(); i++) {
      |                ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 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 0 ms 212 KB Output is correct
2 Incorrect 1 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 0 ms 212 KB Output is correct
2 Incorrect 1 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 0 ms 212 KB Output is correct
2 Incorrect 1 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 1 ms 212 KB Output is correct
2 Incorrect 1 ms 340 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 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 10 ms 1072 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 428 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 5 ms 692 KB Output is correct
8 Correct 5 ms 724 KB Output is correct
9 Correct 9 ms 1064 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -