QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#432043#370. CityZpairCompile Error//C++141.0kb2024-06-06 16:52:522024-06-06 16:52:53

Judging History

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

  • [2024-06-06 16:52:53]
  • 评测
  • [2024-06-06 16:52:52]
  • 提交

Encoder

#include "Encoder.h"
#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
const db q=1.025;
const int N=2e5+5;
vector<int> e[N];
int f[550],siz[N],mp[N],tot;
void dfs(int p,int fa){
	mp[p]=++tot;
	siz[p]=1;
	for(int t:e[p]){
		if(t==fa)continue;
		dfs(t,p),siz[p]+=siz[t];
	}
	int pos=lower_bound(f,f+520,siz[p])-f;
	tot+=f[pos]-siz[p];siz[p]=f[pos];
	Code(p,pos|((ll)mp[p]<<9));
}
void Encode(int N,int A[],int B[]) {
	for(int i=0;i<N-1;++i) {
		e[A[i]].push_back(B[i]);
		e[B[i]].push_back(A[i]);
	}
	f[0]=1;
	for(int i=1;i<520;++i)
		f[i]=max(f[i-1]+1.0,f[i-1]*q);
	dfs(0,-1);
}

Device

#include "Device.h"
#include<bits/stdc++.h>
using namespace std;
typedef double db;
const db q=1.025;
const int N=2e5+5;
int f[550];
void InitDevice(){
	f[0]=1;
	for(int i=1;i<520;++i)
		f[i]=max(f[i-1]+1.0,f[i-1]*q);
}
int Answer(long long S,long long T){
	int d1=S>>9,s1=f[S&511];
	int d2=T>>9,s2=f[T&511];
	if(d2<=d1&&d1<=d2+s2-1)return 0;
	if(d1<=d2&&d2<=d1+s1-1)return 1;
	return 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/ccTqUOIk.o:(.bss+0x0): multiple definition of `f'; /tmp/ccDyl6qi.o:(.bss+0x186a60): first defined here
collect2: error: ld returned 1 exit status