Submission #282778

# Submission time Handle Problem Language Result Execution time Memory
282778 2020-08-24T22:19:35 Z medmdg Vision Program (IOI19_vision) C++14
0 / 100
8 ms 1072 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K){
    int l=0;
    int r=W*H-1;
    int m=l+r;
    m/=2;
    while(l<=r){
        vector<int> a;
        for(int i=0;i<=m;i++){
            a.push_back(i);
        }
        bool d=add_xor(a);
        if(d){
            break;
        }
        bool dd=add_or(a);
        if(dd){
            r=m-1;
            m=(l+r)/2;
            continue;
        }
        l=m+1;
        m=(l+r)/2;
    }
    int ll=m+1;
    int rr=r;
    r=m;
    int mm=(ll+rr)/2;
    while(l<=r){
        vector<int> a;
        for(int i=0;i<=m;i++){
            a.push_back(i);
        }
        bool d=(add_or(a)==1);
        if(d){
            if(add_not(m)==0){
                break;
            }
            r=m-1;
            m=(l+r)/2;
            continue;
        }
        l=m+1;
        m=(l+r)/2;
    }
    while(ll<=rr){
        vector<int> a;
        for(int i=ll;i<=mm;i++){
            a.push_back(i);
        }
        bool d=(add_or(a)==1);
        if(d){
            if(add_not(mm)==0){
                break;
            }
            rr=mm-1;
            mm=(ll+rr)/2;
            continue;
        }
        ll=mm+1;
        mm=(ll+rr)/2;
    }
    vector<int> k;
    k.push_back(m);
    k.push_back(mm);
    if(abs((int)(m%W)-(int)(mm%W))+abs((int)(m/W)-(int)(mm/W))==K){
        add_and(k);
    }
    add_not(m);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 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 0 ms 256 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 0 ms 256 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 0 ms 256 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 1 ms 256 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 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 8 ms 1072 KB on inputs (126, 120), (176, 169), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -