답안 #129222

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
129222 2019-07-11T21:05:12 Z mraron 질문 (CEOI14_question_grader) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
int main() {
    vector<int> sts;
    for(int i=0;i<(1<<12);++i) {
        int cnt=0;
        for(int j=0;j<12;++j) {
            cnt+=((1<<j)&i)!=0;
        }
        if(cnt==6) sts.push_back(i);
    }

    int typ;
    cin>>typ;
    if(typ==1) {
        int n,t;
        cin>>n>>t;
        for(int i=0;i<t;++i) {
            int x,y;
            cin>>x>>y;
            int X=sts[x], Y=sts[Y];
            int h=-1;
            for(int j=0;j<12;++j) {
                if((X&(1<<j)) && !(Y&(1<<j))) h=j+1;
            }
            cout<<h<<"\n";
        }
    }else {
        int n,t;
        cin>>n>>t;
        for(int i=0;i<t;++i) {
            int q,h;
            cin>>q>>h;
            cout<<((sts[q]&(1<<(h-1)))?"yes":"no")<<"\n";
        }
    }

    return 0;
}



    

Compilation message

encoder.cpp: In function 'int main()':
encoder.cpp:21:34: warning: 'Y' may be used uninitialized in this function [-Wmaybe-uninitialized]
             int X=sts[x], Y=sts[Y];
                                  ^
/tmp/ccTAc3kf.o: In function `main':
grader_encode.c:(.text.startup+0x0): multiple definition of `main'
/tmp/ccRDMjkw.o:encoder.cpp:(.text.startup+0x0): first defined here
/tmp/ccTAc3kf.o: In function `main':
grader_encode.c:(.text.startup+0x10a): undefined reference to `encode(int, int, int)'
collect2: error: ld returned 1 exit status

/tmp/ccrADQ2c.o: In function `main':
grader_decode.c:(.text.startup+0x19f): undefined reference to `decode(int, int, int)'
collect2: error: ld returned 1 exit status