제출 #1330094

#제출 시각아이디문제언어결과실행 시간메모리
1330094gkos5678질문 (CEOI14_question_grader)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

const int maxn = 930;

int ab, n, t, br[maxn];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tr = 1;
    for (int i = 1; i < (1 << 12); i++){
        if (__builtin_popcount(i) != 6)
            continue;
        br[tr] = i;
        tr++;
    }
    cin >> ab >> n >> t;
    while(t--){
        if (ab == 1){
            int x, y;
            cin >> x >> y;
            for (int i = 0; i < 12; i++){
                if (((br[x] >> i) & 1) == 1 && ((br[y] >> i) & 1) == 0){
                    cout << i + 1 << "\n";
                    break;
                }
            }
        } else {
            int q, h;
            cin >> q >> h;
            h--;
            if ((br[q] >> h) & 1)
                cout << "yes\n";
            else
                cout << "no\n";
        }
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

const int maxn = 930;

int ab, n, t, br[maxn];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tr = 1;
    for (int i = 1; i < (1 << 12); i++){
        if (__builtin_popcount(i) != 6)
            continue;
        br[tr] = i;
        tr++;
    }
    cin >> ab >> n >> t;
    while(t--){
        if (ab == 1){
            int x, y;
            cin >> x >> y;
            for (int i = 0; i < 12; i++){
                if (((br[x] >> i) & 1) == 1 && ((br[y] >> i) & 1) == 0){
                    cout << i + 1 << "\n";
                    break;
                }
            }
        } else {
            int q, h;
            cin >> q >> h;
            h--;
            if ((br[q] >> h) & 1)
                cout << "yes\n";
            else
                cout << "no\n";
        }
    }
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

# 1번째 컴파일 단계

/usr/bin/ld: /tmp/ccNPcWgv.o: in function `main':
grader_encode.c:(.text.startup+0x0): multiple definition of `main'; /tmp/ccrIr6zU.o:encoder.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccNPcWgv.o: in function `main':
grader_encode.c:(.text.startup+0x13a): undefined reference to `encode(int, int, int)'
collect2: error: ld returned 1 exit status