제출 #1221866

#제출 시각아이디문제언어결과실행 시간메모리
1221866vladilius질문 (CEOI14_question_grader)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int n, tt; cin>>n>>tt;
    while (tt--){
        int x, y; cin>>x>>y;
        if (x > y){
            for (int i = 10; i >= 1; i--){
                int j = i - 1;
                bool x1 = (x >> j) & 1, y1 = (y >> j) & 1;
                if (x1 != y1){
                    cout<<i<<"\n";
                    break;
                }
            }
        }
        else {
            for (int i = 10; i >= 1; i--){
                int j = i - 1;
                bool x1 = (x >> j) & 1, y1 = (y >> j) & 1;
                if (x1 != y1){
                    cout<<i + 10<<"\n";
                    break;
                }
            }
        }
    }
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second

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

    int n, tt; cin>>n>>tt;
    while (tt--){
        int q, h; cin>>q>>h;
        if (h <= 10){
            if ((q >> (h - 1)) & 1){
                cout<<"yes"<<"\n";
            }
            else {
                cout<<"no"<<"\n";
            }
        }
        else {
            h -= 10;
            if ((q >> (h - 1)) & 1){
                cout<<"no"<<"\n";
            }
            else {
                cout<<"yes"<<"\n";
            }
        }
    }
}

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

# 1번째 컴파일 단계

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