답안 #256552

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
256552 2020-08-02T20:32:08 Z fivefourthreeone Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a);i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"ayaya~"<<endl
 
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
gpu_hash_map<int, int> mp;*/
using ll = long long;
using ld = long double;
const ll MOD = 1000000007;
const ll root = 62;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
const double PI = acos(-1);
const double eps = -1e6;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
int h, w, k;
int cnt = h*w;
void add_not(int a){}
void add_or(vector<int> a){}
void add_and(vector<int> a){}
void add_xor(vector<int> a){}
int _add_not(int a) {add_not(a);return cnt++;}
int _add_or(vector<int> a) {add_or(a);return cnt++;}
int _add_and(vector<int> a) {add_and(a);return cnt++;}
int _add_xor(vector<int> a) {add_xor(a);return cnt++;}
int val(int x, int y) {
    return x*w + y;
}
int solve(int d) {
    //query for all up diagonals
    vector<int> qq;
    vector<int> up;
    vector<int> down;
    owo(i, 0, h) {
        qq.clear();
        owo(j, 0, min(i+1, w)) {
            qq.senpai(val(i-j, j));
        }
        //up.senpai(_add_or(qq));
    }
    owo(i, 1, w) {
        qq.clear();
        owo(j, 0, min(h, w-i)) {
            qq.senpai(val(h-j-1, i+j));
        }
        //up.senpai(_add_or(qq));
    }
    //query for down diagonals
    uwu(i, h, 0) {
        qq.clear();
        owo(j, 0, min(h-i, w)) {
            qq.senpai(val(i+j, j));
        }
        //down.senpai(_add_or(qq));
    }
    owo(i, 1, w) {
        qq.clear();
        owo(j, 0, min(h, w-i)) {
            qq.senpai(val(j, i+j));
        }
        //down.senpai(_add_or(qq));
    }
    vector<int> preup;
    owo(i, 0, up.size()) {
        if(i==0)preup.senpai(_add_xor({up[i]}));
        else {
            preup.senpai(_add_xor({up[i], preup[i-1]}));
        }
    }
    vector<int> predown;
    owo(i, 0, down.size()) {
        if(i==0)predown.senpai(_add_xor({down[i]}));
        else {
            predown.senpai(_add_xor({up[i], predown[i-1]}));
        }
    }
    int upval;
    int downval;
    owo(i, 0, up.size()-d) {
        qq.clear();
        owo(j, i, i+d) {
            qq.senpai(preup[j]);
        }
        upval = _add_or({upval, _add_and(qq)});
    }
    owo(i, 0, down.size()-d) {
        qq.clear();
        owo(j, i, i+d) {
            qq.senpai(predown[j]);
        }
        downval = _add_or({downval, _add_and(qq)});
    }
    return _add_or({upval, downval});
}
void construct_network(int H, int W, int K) {
    h = H;
    w = W;
    k = K;
    solve(0);
    if(w+h-2==k)solve(k);
    else _add_and({solve(k), _add_not(solve(k+1))});
}
int main() {
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    cin.tie(0)->sync_with_stdio(0);
    return 0;
}

Compilation message

vision.cpp: In function 'int solve(int)':
vision.cpp:2:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define owo(i,a, b) for(int i=(a);i<(b); ++i)
                                    ^
vision.cpp:73:5: note: in expansion of macro 'owo'
     owo(i, 0, up.size()) {
     ^~~
vision.cpp:2:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define owo(i,a, b) for(int i=(a);i<(b); ++i)
                                    ^
vision.cpp:80:5: note: in expansion of macro 'owo'
     owo(i, 0, down.size()) {
     ^~~
vision.cpp:2:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define owo(i,a, b) for(int i=(a);i<(b); ++i)
                                    ^
vision.cpp:88:5: note: in expansion of macro 'owo'
     owo(i, 0, up.size()-d) {
     ^~~
vision.cpp:2:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define owo(i,a, b) for(int i=(a);i<(b); ++i)
                                    ^
vision.cpp:95:5: note: in expansion of macro 'owo'
     owo(i, 0, down.size()-d) {
     ^~~
vision.cpp:102:19: warning: 'upval' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return _add_or({upval, downval});
            ~~~~~~~^~~~~~~~~~~~~~~~~~
vision.cpp:102:19: warning: 'downval' may be used uninitialized in this function [-Wmaybe-uninitialized]
/tmp/cc9Dnc55.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccs4a5Oh.o:vision.cpp:(.text.startup+0x0): first defined here
/tmp/cc9Dnc55.o: In function `add_not(int)':
grader.cpp:(.text+0x230): multiple definition of `add_not(int)'
/tmp/ccs4a5Oh.o:vision.cpp:(.text+0x130): first defined here
/tmp/cc9Dnc55.o: In function `add_and(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x460): multiple definition of `add_and(std::vector<int, std::allocator<int> >)'
/tmp/ccs4a5Oh.o:vision.cpp:(.text+0x150): first defined here
/tmp/cc9Dnc55.o: In function `add_or(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x630): multiple definition of `add_or(std::vector<int, std::allocator<int> >)'
/tmp/ccs4a5Oh.o:vision.cpp:(.text+0x140): first defined here
/tmp/cc9Dnc55.o: In function `add_xor(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x800): multiple definition of `add_xor(std::vector<int, std::allocator<int> >)'
/tmp/ccs4a5Oh.o:vision.cpp:(.text+0x160): first defined here
collect2: error: ld returned 1 exit status