QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#519904#5090. 妙妙题c20230201Compile Error//C++17837b2024-08-15 09:20:392024-08-15 09:20:39

Judging History

This is the latest submission verdict.

  • [2024-08-15 09:20:39]
  • Judged
  • [2024-08-15 09:20:39]
  • Submitted

answer

#include<bits/stdc++.h>
#include "tmp.h"
// #include "grader.cpp"

using namespace std;

typedef long double db;
const db eps=1e-10;


int N, T;

void init(int n,int type,int p) {
	N=n, T=type;
	return ;
}

struct node {
	db a;
	db b;
};
void operator += (node& x, node y) {
	x.a+= y.a;
	x.b+= y.b;
	return ;
}

db operator * (node x,node y) {
	return x.a*y.b-x.b*y.a;
}

int sgn(db x) {
	if(fabs(x)<eps) return 0;
	if(x>eps) return 1;
	return -1;
}

const db pi=acos(1.0);

bool guess(unsigned long long A,int x) {
	node p=(node){0,0};
	int sum=0;
	for(int i=0;i<N-1;i++) {
		int v=(A>>i)&1;
		if(v) p+= (node){cos(2*pi*(i+1)/N), sin(2*pi*(i+1)/N)}, sum^=1;
	}
	if(sgn(p.a)==0&&sgn(p.b)==0) return 0;
	int f=sgn(p*(node){1,0});
	if(!f) return 1;
	if(f>0) return sum;
	return sum^1;
}

Details

implementer.cpp: In function ‘int _JFIBEIIYTAFEUXOULOWO_::main()’:
implementer.cpp:18:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   18 |         scanf("%d%d%d%d",&N,&Type,&p,&T);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
implementer.cpp:23:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   23 |                 scanf("%llu",&x);
      |                 ~~~~~^~~~~~~~~~~
/usr/bin/ld: /tmp/ccH9Z7hq.o: in function `_JFIBEIIYTAFEUXOULOWO_::main()':
implementer.cpp:(.text.startup+0x6c): undefined reference to `init(int, bool, int)'
collect2: error: ld returned 1 exit status