QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#559312#8221. 多方计算-xcxxx-Compile Error//C++141.0kb2024-09-11 21:19:362024-09-11 21:19:36

Judging History

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

  • [2024-09-11 21:19:36]
  • 评测
  • [2024-09-11 21:19:36]
  • 提交

answer

#include<bits/stdc++.h>
#include "grader.cpp"
// #include "mpc.h"
using namespace std;
int rd() {int x=0,f=1;char c=getchar();while(!isdigit(c))f=c=='-'?-1:f,c=getchar();while(isdigit(c))x=x*10+(c^48),c=getchar();return x*f;}
int n,m;
int precalc(int n,int m) {
    srand(time(0));
    ::n=n,::m=m;
    return n+m+4;
}
int calc(int pos,int round) {
    int res=round-pos-1;
    if(res<0) res+=m+11;
    if(res>=0) return res;
    return -1;
}
bool transmit(player &player,int round,int pos) {
    int p=calc(pos-1,round-1);
    if(p!=-1) {
        player.memory[p]+=player.last_message;
        for(int i=p;i<m+__lg(n)+1;i++) {
            if(player.memory[i]>1) player.memory[i+1]++,player.memory[i]-=2;
            else break;
        }
    }
    p=calc(pos,round);
    if(p==-1) return 0;
    // fprintf(stderr,"pos=%d round=%d trans=%d\n",pos,round,p);
    // for(int i=0;i<20;i++) fprintf(stderr,"%d",player.memory[i]);
    // fprintf(stderr,"\n");
    int v=player.memory[p];
    if(pos!=n) player.memory[p]=0;
    return v;
}

Details

answer.code:2:10: fatal error: grader.cpp: No such file or directory
    2 | #include "grader.cpp"
      |          ^~~~~~~~~~~~
compilation terminated.