Submission #564780

#TimeUsernameProblemLanguageResultExecution timeMemory
564780katwamiawQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
27 / 100
3083 ms24124 KiB
int encode (int n, int x, int y) {
    int r ;
    for(int i=0 ; i<10 ; i++){
        if((x&(1<<i))!=(y&(1<<i))){
            r=i+1 ;
            if((y&(1<<i))) r+=10 ;
            return (r) ;
        }
    }
    return 1 ;
}
int decode (int n, int q, int h) {
    h-- ;
	if(h>=10){
        h-=10 ;
        if((q&(1<<h))) return 0 ;
        return 1 ;
    }
    if((q&(1<<h))) return 1 ;
    return 0 ;
}
#Verdict Execution timeMemoryGrader output
Fetching results...