Submission #992279

# Submission time Handle Problem Language Result Execution time Memory
992279 2024-06-04T08:15:07 Z MarwenElarbi Vision Program (IOI19_vision) C++17
0 / 100
2 ms 1236 KB
#include <bits/stdc++.h>
#include "vision.h"

using namespace std;
#define fi first
#define se second
#define ll long long
#define pb push_back



void construct_network(int H, int W, int K) {
    bool grid[H+1][W];
    pair<int,int> fst={-1,-1};
    pair<int,int> lst={-1,-1};
    pair<int,int> wa={-1,-1};
    for (int i = 0; i < H; ++i)
    {
        for (int j = 0; j < W; ++j)
        {
            vector<int> tab;
            tab.pb(i*W+j);
            grid[i][j]=add_and(tab);
            //cout <<add_and(tab)<<" ";
            tab.pop_back();
            if(grid[i][j]==1&&fst==make_pair(-1,-1)){
                fst={i,j};
            }else if(grid[i][j]==1){
                lst={i,j};
            }
        }//cout <<endl;
    }
    //cout <<fst.fi<<" "<<fst.se<<" "<<lst.fi<<" "<<lst.se<<endl;
    if(abs(fst.fi-lst.fi)+abs(lst.se-fst.se)==K) add_and({fst.fi*W+fst.se});
    else add_not(fst.fi*W+fst.se);
    return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:16:19: warning: variable 'wa' set but not used [-Wunused-but-set-variable]
   16 |     pair<int,int> wa={-1,-1};
      |                   ^~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 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 344 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 344 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 344 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 348 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 348 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 2 ms 1236 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -