Submission #249692

# Submission time Handle Problem Language Result Execution time Memory
249692 2020-07-15T14:47:16 Z LittleFlowers__ Vision Program (IOI19_vision) C++17
0 / 100
3 ms 1276 KB
#include <bits/stdc++.h>
using namespace std;
#define in ({int x=0;int c=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';n?-x:x;})
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l,int r){return l+rng()%(r-l+1);}
#define fasty ios_base::sync_with_stdio(0),cin.tie(0);
#define forinc(a,b,c) for(int a=b,_c=c;a<=_c;++a)
#define fordec(a,b,c) for(int a=b,_c=c;a>=_c;--a)
#define forv(a,b) for(auto&a:b)
#define fi first
#define se second
#define pb push_back
#define ii pair<int,int>
#define mt make_tuple
#define all(a) a.begin(),a.end()
#define reset(f, x) memset(f, x, sizeof(f))
#define gg exit(0);

#ifndef UNX
#include "vision.h"
#endif

int D[]={-1,-1,1,1};
int C[]={-1,1,1,-1};

const int N=210;

int it;
int id[N][N];

void construct_network(int m, int n, int w){
    forinc(i,1,m) forinc(j,1,n) id[i][j]=it++;
    ii x={0,0},y;
    int z,l;
    forinc(i,1,m) forinc(j,1,n) if(!add_not(id[i][j])){
        l=id[i][j];
        x=x.fi?x:ii(i,j);
        y={i,j};
    } else z=id[i][j];
    if(abs(x.fi-y.fi)+abs(x.se-y.se)==w) add_not(z); else add_not(l);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:40:66: warning: 'l' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if(abs(x.fi-y.fi)+abs(x.se-y.se)==w) add_not(z); else add_not(l);
                                                           ~~~~~~~^~~
vision.cpp:40:49: warning: 'z' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if(abs(x.fi-y.fi)+abs(x.se-y.se)==w) add_not(z); else add_not(l);
                                          ~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1276 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -