답안 #94811

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
94811 2019-01-24T08:43:27 Z popovicirobert popa (BOI18_popa) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define ld long double
// 217
// 44
#include <popa.h>


using namespace std;



const int MAXN = 1000;

int l[MAXN + 1], r[MAXN + 1];
int stk[MAXN + 1];

inline int query(int a, int b, int c, int d) {
    cout << 0 << " " << a << " " << b << " " << c << " " << d << "\n";
    int ans;
    cin >> ans;
    return ans;

}

inline int solve(int n, int *l, int *r) {
    int i;
    for(i = 0; i < n; i++) {
        l[i] = r[i] = -1;
    }
    int sz = 0;
    for(i = 0; i < n; i++) {
        while(sz > 0 && query(i, i, stk[sz], i)) {
            if(sz > 1 && query(i, i, stk[sz - 1], i)) {
                r[stk[sz - 1]] = stk[sz];
            }
            else {
                l[i] = stk[sz];
            }
            sz--;
        }
        stk[++sz] = i;
    }
    while(sz > 1) {
        r[stk[sz - 1]] = stk[sz];
        sz--;
    }
    return stk[1];
}

int main() {
    //ifstream cin("A.in");
    //ofstream cout("A.out");
    int i, t;
    ios::sync_with_stdio(false);
    //cin.tie(0), cout.tie(0);
    /*cin >> t;
    while(t > 0) {
        t--;
        int n;
        cin >> n;
        solve(n);
        cout << 1 << "\n" << stk[1] << "\n";
        for(i = 0; i < n; i++) {
            cout << l[i] << " ";
        }
        cout << "\n";
        for(i = 0; i < n; i++) {
            cout << r[i] << " ";
        }
        cout << "\n";
    }*/
    //cin.close();
    //cout.close();
    return 0;
}

Compilation message

popa.cpp: In function 'int main()':
popa.cpp:56:9: warning: unused variable 'i' [-Wunused-variable]
     int i, t;
         ^
popa.cpp:56:12: warning: unused variable 't' [-Wunused-variable]
     int i, t;
            ^
/tmp/ccxKWG8U.o: In function `main':
popa.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc2iQDH3.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/cc2iQDH3.o: In function `main':
grader.cpp:(.text.startup+0xd9): undefined reference to `solve(int, int*, int*)'
collect2: error: ld returned 1 exit status