Submission #749247

# Submission time Handle Problem Language Result Execution time Memory
749247 2023-05-27T15:11:43 Z grogu Vision Program (IOI19_vision) C++14
0 / 100
4 ms 2512 KB
#include "vision.h"
#define here cerr<<"===========================================\n"
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#include <bits/stdc++.h>
#define ld double
#define ll int
#define ull unsigned long long
#define llinf 100000000000000000LL // 10^17
#define iinf 2000000000 // 2*10^9
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define eb emplace_back
#define all(a) a.begin(),a.end()
#define ceri(a,l,r) {cerr<<#a<<": ";for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
#define cer(a) {cerr<<#a<<": ";for(ll x_ : a) cerr<<x_<< " ";cerr<<endl;}
#define si(a) (ll)(a.size())
using namespace std;
#define maxn 205
vector<ll> aks;
ll n,m,k;
ll kod(ll x,ll y){return (x-1)*m+y-1;}
ll reshi(vector<vector<ll> > v,ll k){
    vector<ll> vor,vxor;
    for(auto w : v){
        vor.pb(add_or(w));
        vxor.pb(add_xor(w));
    }
    vector<ll> vok;
    for(ll i = 0;i+k-1<si(v);i++){
        vector<ll> cur;
        for(ll j = i;j<=i+k-1;j++) cur.pb(vor[j]);
        ll x = add_or(cur);
        cur.clear();
        for(ll j = 1;j<=i+k-1;j++) cur.pb(vxor[j]);
        ll y = add_not(add_xor(cur));
        cur.clear();
        vok.pb(add_and({x,y}));
    }
    return add_or(vok);
}
ll reshi(ll k){
    vector<vector<ll> > diag;
    for(ll s = 2;s<=n+m;s++){
        vector<ll> v;
        for(ll i = 1;i<=n;i++){
            ll j = s-i;
            if(j>m||j<=0) continue;
            v.eb(kod(i,j));
        }
        diag.pb(v);
    }
    ll i = reshi(diag,k);
    diag.clear();
    for(ll s = 1-m;s<=n-1;s++){
        vector<ll> v;
        for(ll i = 1;i<=n;i++){
            ll j = i - s;
            if(j>m||j<=0) continue;
            v.eb(kod(i,j));
        }
        diag.pb(v);
    }
    ll j = reshi(diag,k);
    return add_xor({i,j});
}
void construct_network(int H, int W, int K) {
    n = H;
    m = W;
    k = K;
    ll i = reshi(k+1);
    ll j = reshi(k);
    j = add_not(j);
    add_and({i,j});
}
/**
2 3 3
0 0 1 2
0 2 1 0
**/
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 684 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 2512 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -