Submission #282828

# Submission time Handle Problem Language Result Execution time Memory
282828 2020-08-25T03:52:32 Z muhammad_hokimiyon Vision Program (IOI19_vision) C++14
0 / 100
474 ms 1772 KB
#include "vision.h"
#include <bits/stdc++.h>

using namespace std;

int dist( int x1 , int y1 , int x2 , int y2 )
{
    return abs(x1 - x2) + abs(y1 - y2);
}

void construct_network(int H, int W, int K)
{
    int n = H;
    int m = W;
    vector < pair < int , int > > ask;
	for( int i = 0; i < n; i++ ){
        for( int j = 0; j < m; j++ ){
            for( int h = i; h < n; h++ ){
                for( int g = j; g < m; g++ ){
                    int x = dist( i , j , h , g );
                    if( x == K ){
                        ask.push_back({ i * m + j , h * m + g });
                    }
                }
            }
        }
	}
	vector < int > res;
	int cur = n * m;
	for( auto x : ask ){
        vector < int > g;
        g.push_back(x.first);
        g.push_back(x.second);
        res.push_back( add_and( g ) );
	}
    vector < int > g;
    g.push_back(cur);
    g.push_back(cur + (int)res.size() - 1);
	int ans = add_or( g );
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:39:6: warning: unused variable 'ans' [-Wunused-variable]
   39 |  int ans = add_or( g );
      |      ^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 0 ms 256 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 0 ms 256 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 0 ms 256 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 0 ms 256 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 474 ms 1772 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 0 ms 256 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
6 Halted 0 ms 0 KB -