QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#492143#4912. WereYouLastCrazyFungiCompile Error//C++14539b2024-07-26 09:50:322024-07-26 09:50:39

Judging History

你现在查看的是最新测评结果

  • [2024-07-26 09:50:39]
  • 评测
  • [2024-07-26 09:50:32]
  • 提交

answer

bool query(int);
void modify(int,bool);

bool WereYouLast(int n,int m){
    int p[6];
    for(int i=1;i<=5;++i) p[i]=query(i);
    int z=0;
    for(int i=1;i<=5;++i) z|=p[i]<<5-i;
    if(z==__lg(n)) return 1;
    if(query(z+5)){
        modify(z+5,0);
        for(int i=1;i<=5;++i) modify(i,0);
    }
    else{
        modify(z+5,1);
        for(int i=5;i>=1;--i){
            if(!p[i]){
                modify(i,1);
                break;
            }
            else modify(i,0);
        }
    }
    return 0;
}

Details

answer.code: In function ‘bool WereYouLast(int, int)’:
answer.code:9:11: error: ‘__lg’ was not declared in this scope
    9 |     if(z==__lg(n)) return 1;
      |           ^~~~