Submission #424844

# Submission time Handle Problem Language Result Execution time Memory
424844 2021-06-12T10:49:57 Z madlogic Vision Program (IOI19_vision) C++17
0 / 100
4 ms 1480 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K) {
  vector<vector<vector<int>>> dp(3, vector<vector<int>>(H, vector<int>(W, -1)));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      vector<int> v{i * W + j};
      for (int x = 0; x <= K; x++) {
        int y = K - x;
        set<int> s;
        s.insert(y);
        s.insert(-y);
        for (int ys : s) {
          int dx = i + y;
          int dy = j + ys;
          if (dx >= 0 && dx < H && dy >= 0 && dy < W) {
            int yy = dx * W + dy;
            v.push_back(yy);
          }
        }
      }
      dp[0][i][j] = add_xor(v);
      dp[1][i][j] = add_or(v);
      reverse(v.begin(), v.end());
      v.pop_back();
      if (!v.empty()) {
        dp[2][i][j] = add_xor(v);
      } 
    }
  }
  vector<int> v;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      int a = dp[0][i][j];
      int b = dp[1][i][j];
      if (dp[2][i][i] != -1) {
        int id1 = add_xor({a, b});
        int idx = add_and({id1, dp[2][i][j]});
        v.push_back(idx);
      }
    }
  }
  add_or(v);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1480 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -