답안 #673123

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
673123 2022-12-19T18:51:03 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];
        if(r1 == 1 && r2 == 2){
            for(int i=0;i<1000000;i++) ans.push_back(i);
            add_or(ans);
        }
        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++;
                }
            }
        }
    }
    int out = 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:39:25: warning: unused variable 'out' [-Wunused-variable]
   39 |                     int out = add_and(vector<int>{r1*w+i, r2*w+j});
      |                         ^~~
vision.cpp:46:9: warning: unused variable 'out' [-Wunused-variable]
   46 |     int out = add_or(ans);
      |         ^~~
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 0 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 -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -