제출 #721476

#제출 시각아이디문제언어결과실행 시간메모리
721476nguyentunglamVision Program (IOI19_vision)C++17
44 / 100
199 ms2312 KiB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
const int N = 200 + 10;
int row[N], col[N];
void construct_network(int h, int w, int K) {
    vector<int> lst;
    if (K == 1) {
        for(int i = 0; i < h; i++) {
            vector<int> ask;
            for(int j = 0; j < w; j++) ask.push_back(i * w + j);
            row[i] = add_or(ask);
        }
        for(int j = 0; j < w; j++) {
            vector<int> ask;
            for(int i = 0; i < h; i++) ask.push_back(i * w + j);
            col[j] = add_or(ask);
        }
        vector<int> R, C;
        for(int i = 0; i < h; i++) R.push_back(row[i]);
        for(int j = 1; j < w; j++) C.push_back(add_and({col[j], col[j - 1]}));
        if (!R.empty() && !C.empty()) {
            int ret = add_and({add_xor(R), add_or(C)});
            lst.push_back(ret);
        }
        R.clear(); C.clear();
        for(int j = 0; j < w; j++) C.push_back(col[j]);
        for(int i = 1; i < h; i++) R.push_back(add_and({row[i - 1], row[i]}));
        if (!R.empty() && !C.empty()) {
            int ret = add_and({add_xor(C), add_or(R)});
            lst.push_back(ret);
        }
        int ok = add_or(lst);
    }
    for(int i = 0; i < h; i++) for(int j = 0; j < w; j++) {
        vector<int> ask;
        for(int k = i; k < h; k++) for(int l = 0; l < w; l++) {
            if (i == k && j > l) continue;
            if (abs(i - k) + abs(j - l) == K) ask.push_back(k * w + l);
        }
        if (ask.empty()) continue;
        lst.push_back(add_and({i * w + j, add_or(ask)}));
    }
    if (lst.empty()) return;
    add_or(lst);
}

컴파일 시 표준 에러 (stderr) 메시지

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:13: warning: unused variable 'ok' [-Wunused-variable]
   33 |         int ok = add_or(lst);
      |             ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...