Submission #1048402

# Submission time Handle Problem Language Result Execution time Memory
1048402 2024-08-08T07:21:09 Z nisanduu Vision Program (IOI19_vision) C++14
0 / 100
1 ms 1240 KB
#include "vision.h"
#include <bits/stdc++.h>

using namespace std;

bool c(int i,int j,int n,int m){
    if(i<0||j<0||i>=n||j>=m) return false;
    return true;
}

void construct_network(int H, int W, int K) {
	vector<int> indexes;
	
	int n = H, m = W, k = K;
	for(int i=0;i<H;i++){
	    for(int j=0;j<W;j++){
	        int cr = i*H + j;
	        for(int r=0;r<=k;r++){
	            int rem = k-r;
	            if(c(i+r,j+rem,n,m)){
	                int nin = (i+r)*H + (j+rem);
	                int in = add_and({nin,cr});
	                indexes.push_back(in);
	            }
	            if(c(i-r,j+rem,n,m)){
	                int nin = (i-r)*H + (j+rem);
	                int in = add_and({nin,cr});
	                indexes.push_back(in);
	            }
	            if(c(i+r,j-rem,n,m)){
	                int nin = (i+r)*H + (j-rem);
	                int in = add_and({nin,cr});
	                indexes.push_back(in);
	            }
	            if(c(i-r,j-rem,n,m)){
	                int nin = (i-r)*H + (j-rem);
	                int in = add_and({nin,cr});
	                indexes.push_back(in);
	            }
	        }
	        
	    }
	}
	int f = add_or(indexes);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:44:6: warning: unused variable 'f' [-Wunused-variable]
   44 |  int f = add_or(indexes);
      |      ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB WA in grader: Invalid index
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 1240 KB WA in grader: Too many instructions
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1240 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -