답안 #293201

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
293201 2020-09-07T18:25:00 Z muhammad_hokimiyon Vision Program (IOI19_vision) C++14
14 / 100
19 ms 2300 KB
#include "vision.h"
#include <bits/stdc++.h>

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,m;
int qur;
vector < int > g;
map < int , int > ll , rr;
map < int , vector < int > > l,r;

int o_r( vector < int > v )
{
    qur += 1;
    add_or( v );
    return qur;
}

int an_d( vector < int > v )
{
    qur += 1;
    add_and( v );
    return qur;
}

int xo_r( vector < int > v )
{
    qur += 1;
    add_xor( v );
    return qur;
}

int no_t( int x )
{
    qur += 1;
    add_not( x );
    return qur;
}

int foo( int k )
{
    vector < int > g,ff;
    for( int i = -(n + m); i <= n + m; i++ ){
        bool f = true;
        vector < int > ask;
        for( int j = i; j <= i + k; j++ ){
            if( l[j].empty() ){
                f = false;
                break;
            }
            assert( ll.find(j) != ll.end() );
            ask.push_back( ll[j] );
        }
        if( !f )continue;
        assert( (int)ask.size() == k + 1 );
        int x = o_r( ask );
        int y = xo_r( ask );
        int z = no_t( y );
        g.push_back( an_d( {x , z} ) );
    }
    for( int i = -(n + m); i <= n + m; i++ ){
        bool f = true;
        vector < int > ask;
        for( int j = i; j <= i + k; j++ ){
            if( r[j].empty() ){
                f = false;
                break;
            }
            assert( rr.find(j) != rr.end() );
            ask.push_back( rr[j] );
        }
        if( !f )continue;
        assert( (int)ask.size() == k + 1 );
        int x = o_r( ask );
        int y = xo_r( ask );
        int z = no_t( y );
        ff.push_back( an_d( {x , z} ) );
    }
    return an_d( { o_r( g ), o_r( ff ) } );
}

void construct_network(int H, int W, int K)
{
    n = H;
    m = W;
    qur = n * m - 1;
    for( int i = 0; i < n; i++ ){
        for( int j = 0; j < m; j++ ){
            int x = i - j , y = i + j;
            l[x].push_back(i * m + j);
            r[y].push_back(i * m + j);
        }
    }
    for( int i = -(n + m); i <= n + m; i++ ){
        if( l[i].empty() )continue;
        int x = o_r(l[i]);
        ll[i] = x;
    }
    for( int i = -(n + m); i <= n + m; i++ ){
        if( r[i].empty() )continue;
        int x = o_r( r[i] );
        rr[i] = x;
    }
    int x = foo( K );
    int y = foo( K - 1 );
    vector < int > f;
    f.push_back(x);
    f.push_back(y);
    o_r( f );
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 640 KB Output is correct
2 Incorrect 15 ms 1152 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 1 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 2300 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 3 ms 640 KB Output is correct
4 Correct 6 ms 896 KB Output is correct
5 Correct 3 ms 640 KB Output is correct
6 Correct 3 ms 640 KB Output is correct
7 Correct 15 ms 1536 KB Output is correct
8 Correct 11 ms 1536 KB Output is correct
9 Correct 19 ms 2300 KB Output is correct
10 Correct 0 ms 384 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -