QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#474140#5090. 妙妙题sumi007Compile Error//C++14550b2024-07-12 16:19:362024-07-12 16:19:38

Judging History

This is the latest submission verdict.

  • [2024-07-12 16:19:38]
  • Judged
  • [2024-07-12 16:19:36]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ldb long double
const int N = 77;
const double Pi = acos(-1.0),eps = 1e-6;
int n,a[N];
ldb x[N],y[N];
void init(int N ,bool Type ,int p){
	n = N;
	for(int i=1;i<n;i++) x[i] = sin(2.0*i*Pi/n),y[i] = cos(2.0*i*Pi/n);	
}
bool guess(ull A,int X){
	ldb a = 0,b = 0;bool s = 0;
	for(int i=0;i+1<n;i++) if((A>>i)&1) a += x[i+1],b += y[i+1],s ^= 1; 
	if(fabs(a)<eps && fabs(b)<eps) return 0;
	if(fabs(a)<eps) return 1;
	if(x>0) return (s^1);
	return s;
}

Details

implementer.cpp: In function ‘int _JFIBEIIYTAFEUXOULOWO_::main()’:
implementer.cpp:31:22: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   31 |                 auto [A,x,y,z]=V[i];
      |                      ^
implementer.cpp:36:18: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   36 |         for(auto [A,x,y]:U)
      |                  ^
implementer.cpp:39:22: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   39 |                 auto [A,x,y,z]=V[i];
      |                      ^
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);
      |                 ~~~~~^~~~~~~~~~~
answer.code: In function ‘bool guess(long long unsigned int, int)’:
answer.code:18:13: error: ordered comparison of pointer with integer zero (‘long double*’ and ‘int’)
   18 |         if(x>0) return (s^1);
      |            ~^~