Submission #422843

# Submission time Handle Problem Language Result Execution time Memory
422843 2021-06-10T13:00:16 Z SSRS Vision Program (IOI19_vision) C++14
20 / 100
14 ms 1888 KB
#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
void construct_network(int H, int W, int K){
  int mx = H + W - 1;
  vector<vector<int>> id1(mx), id2(mx);
  for (int i = 0; i < H; i++){
    for (int j = 0; j < W; j++){
      id1[i + j].push_back(i * W + j);
      id2[i - j + (W - 1)].push_back(i * W + j);
    }
  }
  vector<int> a(mx), b(mx);
  for (int i = 0; i < mx; i++){
    a[i] = add_or(id1[i]);
    b[i] = add_or(id2[i]);
  }
  vector<int> id;
  for (int i = 0; i < 2; i++){
    vector<int> A;
    for (int j = 0; j < mx - K; j++){
      A.push_back(add_and({a[j], a[j + K]}));
    }
    vector<int> S(mx + 1);
    S[1] = b[0];
    for (int i = 1; i < mx; i++){
      S[i + 1] = add_xor({S[i], b[i]});
    }
    vector<int> B;
    for (int i = 0; i < mx; i++){
      int l = i + 1;
      int r = min(i + K + 1, mx);
      int x = add_xor({S[l], S[r]});
      B.push_back(add_or({x, S[mx]}));
    }
    id.push_back(add_and({add_or(A), add_or(B)}));
    swap(A, B);
  }
  add_or(id);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 460 KB Output is correct
2 Correct 2 ms 460 KB Output is correct
3 Correct 2 ms 460 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 2 ms 460 KB Output is correct
6 Correct 2 ms 460 KB Output is correct
7 Correct 2 ms 332 KB Output is correct
8 Correct 2 ms 332 KB Output is correct
9 Correct 2 ms 460 KB Output is correct
10 Correct 2 ms 460 KB Output is correct
11 Correct 2 ms 332 KB Output is correct
12 Correct 2 ms 460 KB Output is correct
13 Correct 2 ms 460 KB Output is correct
14 Correct 2 ms 332 KB Output is correct
15 Correct 2 ms 460 KB Output is correct
16 Correct 2 ms 460 KB Output is correct
17 Correct 2 ms 332 KB Output is correct
18 Correct 2 ms 460 KB Output is correct
19 Correct 2 ms 460 KB Output is correct
20 Correct 2 ms 332 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 3 ms 460 KB Output is correct
4 Correct 3 ms 460 KB Output is correct
5 Correct 3 ms 460 KB Output is correct
6 Correct 2 ms 460 KB Output is correct
7 Correct 2 ms 460 KB Output is correct
8 Correct 3 ms 588 KB Output is correct
9 Correct 3 ms 588 KB Output is correct
10 Correct 3 ms 588 KB Output is correct
11 Correct 3 ms 588 KB Output is correct
12 Correct 3 ms 588 KB Output is correct
13 Correct 2 ms 460 KB Output is correct
14 Correct 2 ms 460 KB Output is correct
15 Correct 2 ms 460 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 2 ms 460 KB Output is correct
18 Correct 2 ms 460 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
20 Correct 7 ms 1100 KB Output is correct
21 Correct 9 ms 1100 KB Output is correct
22 Correct 7 ms 1100 KB Output is correct
23 Correct 7 ms 1144 KB Output is correct
24 Correct 7 ms 1068 KB Output is correct
25 Correct 7 ms 1080 KB Output is correct
26 Correct 8 ms 1100 KB Output is correct
27 Correct 13 ms 1888 KB Output is correct
28 Correct 12 ms 1868 KB Output is correct
29 Correct 12 ms 1868 KB Output is correct
30 Correct 14 ms 1740 KB Output is correct
31 Correct 12 ms 1740 KB Output is correct
32 Correct 0 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 1812 KB on inputs (96, 130), (143, 84), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -