Submission #673119

# Submission time Handle Problem Language Result Execution time Memory
673119 2022-12-19T18:26:57 Z tbzard Vision Program (IOI19_vision) C++14
0 / 100
5 ms 724 KB
#include <bits/stdc++.h>
using namespace std;

int add_not(int n);
int add_and(vector<int> ns);
int add_or(vector<int> ns);
int add_xor(vector<int> ns);
void construct_network(int h, int w, int k){
    vector<int> row, ans;
    int cnt = h*w;
    for(int i=0;i<h;i++){
        vector<int> ask;
        for(int j=0;j<w;j++) ask.push_back(i*w+j);
        int out = add_or(ask);
        cnt++;
        if(out) row.push_back(i);
    }
    if(row.size() == 1){
        int r = row[0];
        for(int i=0;i<w;i++){
            for(int j=0;j<w;j++){
                if(abs(i-j) == k){
                    int out = add_and(vector<int>{r*w+i, r*w+j});
                    ans.push_back(cnt);
                    cnt++;
                }
            }
        }

    }
    else{
        int r1 = row[0], r2 = row[1];
        for(int i=0;i<w;i++){
            for(int j=0;j<w;j++){
                if(abs(r1-r2) + abs(i-j) == k){
                    int out = add_and(vector<int>{r1*w+i, r2*w+j});
                    ans.push_back(cnt);
                    cnt++;
                }
            }
        }
    }
    add_or(ans);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:23:25: warning: unused variable 'out' [-Wunused-variable]
   23 |                     int out = add_and(vector<int>{r*w+i, r*w+j});
      |                         ^~~
vision.cpp:36:25: warning: unused variable 'out' [-Wunused-variable]
   36 |                     int out = add_and(vector<int>{r1*w+i, r2*w+j});
      |                         ^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (1, 0), (2, 0), expected 1, but computed 0
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (1, 0), (2, 0), expected 1, but computed 0
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (1, 0), (2, 0), expected 1, but computed 0
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (1, 0), (2, 0), expected 1, but computed 0
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 724 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (1, 0), (2, 0), expected 1, but computed 0
4 Halted 0 ms 0 KB -