Submission #414608

# Submission time Handle Problem Language Result Execution time Memory
414608 2021-05-30T18:05:49 Z ollel Vision Program (IOI19_vision) C++14
47 / 100
11 ms 1100 KB
#include <bits/stdc++.h>
#include <iostream>
#include "vision.h"
using namespace std;

#define rep(i,a,b) for(int i = a; i < b; i++)
#define pb push_back

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int h, w, k, inst;

// bool add_or(vi& q) {
//   cout << "or:\n";
//   for(auto &i : q) cout << i << " ";cout<<endl;
//   bool ans; cin >> ans;
//   return ans;
// }
//
// bool add_not(int x ) {
//   cout << "not:\n";
//   cout << x << endl;
//   bool ans; cin >> ans; return ans;
// }
//
// bool add_and(vi& q) {
//   cout << "and:\n";
//   for(auto &i : q) cout << i << " ";cout<<endl;
//   bool ans; cin >> ans;
//   return ans;
// }


void kone()
{
  vi R;
  rep(i, 0, h) {
    vi indices;
    rep(j, 0, w) indices.pb(j + i*w);
    R.pb(add_or(indices));
  }

  vi C;
  rep(j, 0, w) {
    vi indices;
    rep(i, 0, h) indices.pb(j + i*w);
    C.pb(add_or(indices));
  }

  vi adjc;
  rep(i, 0, w - 1) {
    vi ask = {C[i], C[i + 1]};
    adjc.pb(add_and(ask));
  }
  vi adjr;
  rep(i, 0, h - 1) {
    vi ask = {R[i], R[i + 1]};
    adjr.pb(add_and(ask));
  }

  vi pos;
  vi ask = {add_xor(R), add_or(adjc)};
  pos.pb(add_and(ask));
  ask.clear();
  ask = {add_xor(C), add_or(adjr)};
  pos.pb(add_and(ask));

  add_or(pos);
}

void construct_network(int H, int W, int K)
{
  h = H; w = W; k = K; inst = h * w;
  if (k == 1 && w > 1 && h > 1) {kone(); return;}

  int fi = inst;
  rep(x, 0, w) rep(y, 0, h) {
    vi ask = {x+y*w};
    rep(x2, 0, w) rep(y2, 0, h) {
      if (abs(x2 - x) + abs(y2 - y) == k) {
        vi ask = {x+y*w, x2+y2*w};
        inst = add_and(ask);
      }
    }
  }

  vi ask;
  rep(i,fi,inst+1) ask.pb(i);
  add_or(ask);
}

// int main() {
//   int H ,W, K; cin >> H>>W>>K;construct_network(H, W, K);
// }
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 288 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 1 ms 288 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 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 288 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 1 ms 288 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 288 KB Output is correct
24 Correct 2 ms 332 KB Output is correct
25 Correct 1 ms 292 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 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 288 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 1 ms 288 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 288 KB Output is correct
24 Correct 2 ms 332 KB Output is correct
25 Correct 1 ms 292 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Incorrect 4 ms 968 KB WA in grader: Too many instructions
29 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 288 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 1 ms 288 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 288 KB Output is correct
24 Correct 2 ms 332 KB Output is correct
25 Correct 1 ms 292 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Incorrect 4 ms 968 KB WA in grader: Too many instructions
29 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 224 KB Output is correct
2 Correct 2 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 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 288 KB Output is correct
8 Correct 1 ms 292 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 288 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 376 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 292 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 2 ms 332 KB Output is correct
4 Incorrect 3 ms 968 KB WA in grader: Too many instructions
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1100 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 3 ms 332 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 6 ms 716 KB Output is correct
8 Correct 6 ms 716 KB Output is correct
9 Correct 11 ms 1100 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 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 288 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 1 ms 288 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 288 KB Output is correct
24 Correct 2 ms 332 KB Output is correct
25 Correct 1 ms 292 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Incorrect 4 ms 968 KB WA in grader: Too many instructions
29 Halted 0 ms 0 KB -