Submission #298919

# Submission time Handle Problem Language Result Execution time Memory
298919 2020-09-14T10:27:39 Z kevlee Vision Program (IOI19_vision) C++17
0 / 100
4 ms 2176 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define inf 1000000000
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vp vector<pii>
#define SET(a, b) memset(a, b, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
vi diag[500], diag2[500];
void construct_network(int h, int w, int k) {
  FOR(i, 0, h-1) {
    FOR(j, 0, w-1) {
      diag[i+j].pb(i*w+j);
      diag2[i+w-1-j].pb(i*w+j);
    }
  }
  vi one, two;
  FOR(i, 0, k-1) {
    for (int j = i; j + k <= h + w - 2; j += k) {
      vi query;
      FOR(l, j, j + k) {
        for (auto it: diag[l]) query.pb(it);
      }
      one.pb(add_xor({add_xor(query), add_or(query)}));
    }
    for (int j = i; j + k <= h + w - 2; j += k) {
      vi query;
      FOR(l, j, j + k) {
        for (auto it: diag2[l]) query.pb(it);
      }
      two.pb(add_xor({add_xor(query), add_or(query)}));
    }
  }
  int id = add_and({add_or(one), add_or(two)});
  //----
  one.clear();
  two.clear();
  k--;
  FOR(i, 0, k-1) {
    for (int j = i; j + k <= h + w - 2; j += k) {
      vi query;
      FOR(l, j, j + k) {
        for (auto it: diag[l]) query.pb(it);
      }
      one.pb(add_xor({add_xor(query), add_or(query)}));
    }
    for (int j = i; j + k <= h + w - 2; j += k) {
      vi query;
      FOR(l, j, j + k) {
        for (auto it: diag2[l]) query.pb(it);
      }
      two.pb(add_xor({add_xor(query), add_or(query)}));
    }
  }
  int id2 = add_and({add_or(one), add_or(two)});
  add_and({id, add_not(id2)});
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 544 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 2176 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -