QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#302713#370. CityNATURAL6Compile Error//C++14938b2024-01-11 09:44:092024-01-11 09:44:10

Judging History

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

  • [2024-01-11 09:44:10]
  • 评测
  • [2024-01-11 09:44:09]
  • 提交

Encoder

#include<bits/stdc++.h>
#include "City_lib.h"
using namespace std;
int n,siz[250010],dfn[250010],tot;
vector<int>e[250010];
inline void dfs(int rt,int da)
{
    siz[rt]=1;dfn[rt]=++tot;
    for(int i:e[rt])
    {
        if(i==da)continue;
        dfs(i,rt);siz[rt]+=siz[i];
    }
    int s=1<<(32-__builtin_clz(siz[rt]));
    tot+=s-siz[rt];siz[rt]=s;
    return ;
}
void Encode(int N,int A[],int B[])
{
    n=N;
    for(int i=0;i<n-1;++i)
    {
        e[A[i]].emplace_back(B[i]);
        e[B[i]].emplace_back(A[i]);
    }
    dfs(0,0);
    return ;
}

Device

#include<bits/stdc++.h>
#include "City_lib.h"
using namespace std;
void InitDevice(){return ;}
int Answer(long long S,long long T)
{
    int Mx=(1<<24)-1,dfns,dfnt,sizs,sizt;
    dfns=S&Mx,dfnt=T&mx;
    sizs=1<<(S>>23);sizt=1<<(T>>23);
    if(dfns<=dfnt&&dfnt<=dfns+sizs-1)return 1;
    if(dfnt<=dfns&&dfns<=dfnt+sizt-1)return 0;
    return 2;
}

详细

Encoder.code:2:10: fatal error: City_lib.h: No such file or directory
    2 | #include "City_lib.h"
      |          ^~~~~~~~~~~~
compilation terminated.
Device.code:2:10: fatal error: City_lib.h: No such file or directory
    2 | #include "City_lib.h"
      |          ^~~~~~~~~~~~
compilation terminated.
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);
      |                         ~~~~~^~~~~~~~~~~~~~~~