Submission #815110

#TimeUsernameProblemLanguageResultExecution timeMemory
815110PagodePaivaVision Program (IOI19_vision)C++14
Compilation error
0 ms0 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { // std::vector<int> Ns; // Ns = {0, 1}; // int a = add_and(Ns); // Ns = {0, a}; // int b = add_or(Ns); // Ns = {0, 1, b}; // int c = add_xor(Ns); // add_not(c); int n = H, m = W, k = K; pair <int, int> v[2]; int con = 0; for(int i = 0;i < n;i++){ for(int j = 0;j < m;j++){ int r = add_and({n*i+j}); if(r == 1){ v[con] = {i, j}; con++; } } } int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc); if(res == k) add_or({1}); else add_or({0}); return; }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:21: error: 'struct std::pair<int, int>' has no member named 'fr'
   33 |  int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
      |                     ^~
vision.cpp:33:31: error: 'struct std::pair<int, int>' has no member named 'fr'
   33 |  int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
      |                               ^~
vision.cpp:33:46: error: 'struct std::pair<int, int>' has no member named 'sc'
   33 |  int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
      |                                              ^~
vision.cpp:33:56: error: 'struct std::pair<int, int>' has no member named 'sc'
   33 |  int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
      |                                                        ^~