QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#300248#370. Cityzjy0001Compile Error//C++141.1kb2024-01-07 21:47:192024-01-07 21:47:20

Judging History

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

  • [2024-01-07 21:47:20]
  • 评测
  • [2024-01-07 21:47:19]
  • 提交

Encoder

#include"Encoder.h"
#include<bits/stdc++.h>
#define LL long long
#define LLL __int128
#define uint unsigned
#define ldb long double
#define uLL unsigned long long
using namespace std;
const int N=2.5e5+5;
const ldb BL=1.024;
vector<int>G[N];
int tim,dfn[N],sz[N],pw[512];
inline void dfs(int u,int fa){
    dfn[u]=++tim,sz[u]=1;
    for(auto v:G[u])if(v!=fa)dfs(v,u),sz[u]+=sz[v];
    int k=lower_bound(pw,pw+512,sz[u])-pw;
    sz[u]=pw[k],tim=dfn[u]+sz[u]-1,Code(u,k+512ll*dfn[u]);
}
void Encode(int n,int*U,int*V){
    for(int i=0;i<n-1;++i)G[U[i]].push_back(V[i]),G[V[i]].push_back(U[i]);
    for(int i=pw[0]=1;i<512;++i)pw[i]=max(pw[i-1]+1,(int)(pw[i-1]*BL));
    dfs(0,0);
}

Device

#include"Device.h"
#include<bits/stdc++.h>
#define LL long long
#define LLL __int128
#define uint unsigned
#define ldb long double
#define uLL unsigned long long
using namespace std;
const ldb BL=1.024;
int pw[512];
void InitDevice(){
    for(int i=pw[0]=1;i<512;++i)pw[i]=max(pw[i-1]+1,(int)(pw[i-1]*BL));
}
int Answer(LL X,LL Y){
    int a=X>>8,b=pw[X&511],c=Y>>8,d=pw[Y&511];
    return a<=c&&c<a+b?1:c<=a&&a<c+d?0:2;
}

Details

grader.cpp: In function ‘int main(int, char**)’:
grader.cpp:62:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
   62 |                         printf("%d ", given_code[i]);
      |                                 ~^    ~~~~~~~~~~~~~
      |                                  |                |
      |                                  int              long long int
      |                                 %lld
grader.cpp:73:33: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
   73 |                         scanf("%d", &given_code[i]);
      |                                ~^   ~~~~~~~~~~~~~~
      |                                 |   |
      |                                 |   long long int*
      |                                 int*
      |                                %lld
grader.cpp:44:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   44 |                 scanf("%d%d", &N, &Q);
      |                 ~~~~~^~~~~~~~~~~~~~~~
grader.cpp:46:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   46 |                         scanf("%d%d", &(A[i]), &(B[i]));
      |                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
grader.cpp:49:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   49 |                         scanf("%d%d", &(X[i]), &(Y[i]));
      |                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
grader.cpp:71:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   71 |                 scanf("%d%d", &N, &Q);
      |                 ~~~~~^~~~~~~~~~~~~~~~
grader.cpp:73:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   73 |                         scanf("%d", &given_code[i]);
      |                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
grader.cpp:77:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   77 |                         scanf("%d%d", &X, &Y);
      |                         ~~~~~^~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccBszPyd.o:(.bss+0x0): multiple definition of `pw'; /tmp/ccqQ4pNa.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status