Submission #147436

# Submission time Handle Problem Language Result Execution time Memory
147436 2019-08-29T14:28:28 Z Nucleist Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h> 
#include "vision.h"
using namespace std; 
#define flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ll long long
#define INF 1000000000
#define pb push_back
struct greateri
{
    template<class T>
    bool operator()(T const &a, T const &b) const { return a > b; }
};
map<pair<int,int>,int>gg;
void construct_network(int H,int W,int K)
{
  //flash;
  vector<int>zeros;
  for (int i = 0; i < H; ++i)
  {
     for (int j = 0; j < W; ++j)
     {
       int cell=i*W+j;
       zeros.pb(cell);
     }
  } 
  vector<pair<int,int>>usi;
  vector<int>lasti;
  int i=0,int j=0;
  for (int ka = 0; ka < H; ++ka)
    {
        for (int c = 0; c < W; ++c)
        {
        	int cell1=0;
        	int cell2=ka*W+c;
        if(cell1!=cell2 && gg.find({min(cell1,cell2),max(cell1,cell2)})==gg.end() &&(abs(i-ka)+abs(j-c))==K)
        {
          int one,two;
          gg[{min(cell1,cell2),max(cell1,cell2)}]=1;
          vector<int>now;
          now.pb(cell1),now.pb(cell2);
          one=add_and(now);
          lasti.pb(one);
      	}
        }
      }
  int so = add_xor(lasti);
    //int xo = add_not(doi);
  return;
}
//code the AC sol !
// BS/queue/map

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:32:11: error: expected unqualified-id before 'int'
   int i=0,int j=0;
           ^~~
vision.cpp:39:100: error: 'j' was not declared in this scope
         if(cell1!=cell2 && gg.find({min(cell1,cell2),max(cell1,cell2)})==gg.end() &&(abs(i-ka)+abs(j-c))==K)
                                                                                                    ^
vision.cpp:41:19: warning: unused variable 'two' [-Wunused-variable]
           int one,two;
                   ^~~
vision.cpp:50:7: warning: unused variable 'so' [-Wunused-variable]
   int so = add_xor(lasti);
       ^~