Submission #572882

# Submission time Handle Problem Language Result Execution time Memory
572882 2022-06-05T12:27:58 Z SlavicG Vision Program (IOI19_vision) C++17
0 / 100
405 ms 1048576 KB
#include "vision.h"
#include "bits/stdc++.h"
using namespace std;
 
#define ll long long
 
#define       forn(i,n)              for(int i=0;i<n;i++)
#define          all(v)              v.begin(), v.end()
#define         rall(v)              v.rbegin(),v.rend()
 
#define            pb                push_back
#define          sz(a)               (int)a.size()

/*
int add_not(int N){}
int add_and(vector<int> Ns){}
int add_or(vector<int> Ns){}
int add_xor(vector<int> Ns){}
*/

void construct_network(int H, int W, int K) {
    vector<int> indices;

    bool vis[H][W][H][W];
    forn(a, H) forn(b, W) forn(c, H) forn(d, W) vis[a][b][c][d] = false;
    int oper = H * W;
    for(int i = 0; i < H; ++i) {
        for(int j = 0; j < W; ++j) {
            for(int x = 0; x < H; ++x) {
                for(int y = 0; y < W; ++y) {
                    if(x == i && j == y) continue;
                    if(vis[i][j][x][y]) continue;
                    if(abs(x - i) + abs(y - j) != K) continue;
                    vis[i][j][x][y] = vis[x][y][i][j] = true;
                    vector<int> purice = {i * H + j, x * H + y};
                    sort(all(purice));
                    indices.pb(add_and(purice));
                    assert(indices.back() == oper);
                    ++oper;
                }   
            }
        }
    }
    assert(sz(indices));
    add_or(indices);
}
/*
void solve() {  
    
} 
     
int32_t main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t = 1;
    //cin >> t;
    while(t--) {
        solve();
    }
}   
*/
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 296 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 296 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 296 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 296 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Incorrect 1 ms 340 KB WA in grader: Invalid index
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 17 ms 8916 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 405 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 296 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -