Submission #793060

# Submission time Handle Problem Language Result Execution time Memory
793060 2023-07-25T13:18:25 Z Andrey Vision Program (IOI19_vision) C++14
0 / 100
4 ms 1108 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;

vector<int> ul[1000];
vector<int> ur[1000];

void construct_network(int h, int w, int k) {
    int br = 0;
    for(int i = 0; i < h; i++) {
        for(int j = 0; j < w; j++) {
            ul[i+j].push_back(i*w+j);
            ur[i+w-j-1].push_back(i*w+j);
        }
    }
    int ans1,ans2;
    vector<int> idk1(0);
    vector<int> idk2(0);
    for(int i = 0; i < h*w-1; i++) {
        idk1.push_back(br+h*w);
        add_xor(ul[i]);
        br++;
        idk2.push_back(br+h*w);
        add_xor(ur[i]);
        br++;
    }
    vector<int> wut(0);
    for(int i = 0; i < idk1.size()-k; i++) {
        add_and({idk1[i],idk1[i+k]});
        wut.push_back(h*w+br);
        br++;
    }
    for(int i = 0; i < idk2.size()-k; i++) {
        add_and({idk2[i],idk2[i+k]});
        wut.push_back(h*w+br);
        br++;
    }
    add_or(wut);
    wut.clear();
    ans1 = h*w+br;
    br++;
    vector<int> wow1(0);
    vector<int> wow2(0);
    for(int i = 0; i < idk1.size(); i++) {
        wut.push_back(idk1[i]);
        add_xor(wut);
        wow1.push_back(h*w+br);
        br++;
    }
    wut.clear();
    for(int i = 0; i < idk2.size(); i++) {
        wut.push_back(idk2[i]);
        add_xor(wut);
        wow2.push_back(h*w+br);
        br++;
    }
    wut.clear();
    for(int i = 0; i < idk1.size()-k; i++) {
        add_and({idk1[i],idk1[i+k]});
        add_and({idk2[i],idk2[i+k]});
        wut.push_back(h*w+br);
        wut.push_back(h*w+br+1);
        br+=2;
    }
    add_or(wut);
    wut.clear();
    add_not(h*w+br);
    ans2 = h*w+br;
    add_and({ans1,ans2});
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:28:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |     for(int i = 0; i < idk1.size()-k; i++) {
      |                    ~~^~~~~~~~~~~~~~~
vision.cpp:33:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |     for(int i = 0; i < idk2.size()-k; i++) {
      |                    ~~^~~~~~~~~~~~~~~
vision.cpp:44:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |     for(int i = 0; i < idk1.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
vision.cpp:51:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   51 |     for(int i = 0; i < idk2.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
vision.cpp:58:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   58 |     for(int i = 0; i < idk1.size()-k; i++) {
      |                    ~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 760 KB Output is correct
2 Correct 4 ms 724 KB Output is correct
3 Correct 4 ms 724 KB Output is correct
4 Incorrect 0 ms 340 KB WA in grader: Instruction with no inputs
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Incorrect 1 ms 348 KB WA in grader: Instruction with no inputs
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1108 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -