Submission #1237938

#TimeUsernameProblemLanguageResultExecution timeMemory
1237938Muhammad_AneeqVision Program (IOI19_vision)C++17
Compilation error
0 ms0 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; void construct_network(int n, int m, int k) { map<int,vector<int>>sl,sl1; map<int,int>ind,ind1; for (int i=0;i<n;i++) { for (int j=0;j<m;j++) { sl[i+j].push_back(i*m+j); sl1[i-j].push_back(i*m+j); } } set<int>s,s1; for (auto [i,j]:sl) { ind[i]=add_or(j); s.insert(i); } for (auto [i,j]:sl1) { s1.insert(i); ind1[i]=add_or(j); } vector<int>nx; for (auto i:s) { if (s.find(i+k)==s.end()) continue; vector<int>x; for (int j=i-k;j<=i+k;j++) { if (s1.find(j)!=s1.end()) x.push_back(ind1[j]); } if (x=={}) continue; int g=add_or(x); nx.push_back(add_and({g,ind[i],ind[i+k]})); } for (auto i:s1) { if (s1.find(i+k)==s1.end()) continue; vector<int>x; for (int j=i-k;j<=i+k;j++) { if (s.find(j)!=s.end()) x.push_back(ind[j]); } if (x=={}) continue; int g=add_or(x); nx.push_back(add_and({g,ind1[i],ind1[i+k]})); } add_or(nx); return; }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:37:32: error: expected primary-expression before '{' token
   37 |                         if (x=={})
      |                                ^
vision.cpp:37:32: error: expected ')' before '{' token
   37 |                         if (x=={})
      |                            ~   ^
      |                                )
vision.cpp:51:32: error: expected primary-expression before '{' token
   51 |                         if (x=={}) continue;
      |                                ^
vision.cpp:51:32: error: expected ')' before '{' token
   51 |                         if (x=={}) continue;
      |                            ~   ^
      |                                )