QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#429538#8221. 多方计算RegisterCompile Error//C++20351b2024-06-02 16:40:312024-06-02 16:40:32

Details

answer.code: In function ‘bool transmit(player&, int, int)’:
answer.code:2:298: error: ‘position’ was not declared in this scope
    2 | const int B=8,C=4;int N,M;int precalc(int n,int m){N=n,M=m;return n+m+3;}bool transmit(player&a,int r,int p){int np=r-p-1,o=a.last_message,lp;if(np<0){if(np>=-B)np=np+M+C;else np=np+M+B+11;}if(np<0)return 0;if(o){lp=np;while(a.memory[lp])a.memory[lp]=0,++lp;a.memory[lp]=1;}bool u=a.memory[np];if(position!=N)a.memory[np]=0;return u;}
      |                                                                                                                                                                                                                                                                                                          ^~~~~~~~