QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#474340#5090. 妙妙题bai_hongCompile Error//C++14788b2024-07-12 17:31:192024-07-12 17:31:19

Judging History

This is the latest submission verdict.

  • [2024-07-12 17:31:19]
  • Judged
  • [2024-07-12 17:31:19]
  • Submitted

answer

#include<bits/stdc++.h>
#include "tmp.h"
const double Pi=acos(-1);
const double eps=1e-8;
using namespace std;
struct plex{
	double x,y;
	plex(){ x=y=0; }
	plex operator +(const plex &t)const{
		return {x+t.x,y+t.y};
	}
	plex operator *(const plex &t)const{
		return {x*t.x-y*t.y,x*t.y+y*t.x};
	}
};
int n;
inline int sgn(double x){ return x<-eps ? -1:x>eps; }
inline int mul(plex a,plex b){ double r=a.x*b.y-a.y*b.x; return sgn(r); }
void init(int N,bool tp,int id){ n=N; return ; }
bool guess(unsigned long long S,int x){
	plex W1={cos(Pi*2/n),sin(Pi*2/n)};
	plex now=W1,sum={0,0}; int Bc=0;
	for (int i=0;i<n-1;i++,now=now*W1)
		if (S>>i&1) Bc++,sum+=now;
	int t=mul(sum,now);
	if (!sgn(sum.x)&&!sgn(sum.y)) return 0;
	return t<0 ? Bc&1:(t>0 ? (Bc&1)^1:1);
}

详细

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 member function ‘plex plex::operator+(const plex&) const’:
answer.code:10:36: error: could not convert ‘{(((double)((const plex*)this)->plex::x) + ((double)t.plex::x)), (((double)((const plex*)this)->plex::y) + ((double)t.plex::y))}’ from ‘<brace-enclosed initializer list>’ to ‘plex’
   10 |                 return {x+t.x,y+t.y};
      |                                    ^
      |                                    |
      |                                    <brace-enclosed initializer list>
answer.code: In member function ‘plex plex::operator*(const plex&) const’:
answer.code:13:48: error: could not convert ‘{((((double)((const plex*)this)->plex::x) * ((double)t.plex::x)) - (((double)((const plex*)this)->plex::y) * ((double)t.plex::y))), ((((double)((const plex*)this)->plex::x) * ((double)t.plex::y)) + (((double)((const plex*)this)->plex::y) * ((double)t.plex::x)))}’ from ‘<brace-enclosed initializer list>’ to ‘plex’
   13 |                 return {x*t.x-y*t.y,x*t.y+y*t.x};
      |                                                ^
      |                                                |
      |                                                <brace-enclosed initializer list>
answer.code: In function ‘bool guess(long long unsigned int, int)’:
answer.code:21:41: error: could not convert ‘{cos(((((double)Pi) * (double)2) / (double)n)), sin(((((double)Pi) * (double)2) / (double)n))}’ from ‘<brace-enclosed initializer list>’ to ‘plex’
   21 |         plex W1={cos(Pi*2/n),sin(Pi*2/n)};
      |                                         ^
      |                                         |
      |                                         <brace-enclosed initializer list>
answer.code:22:29: error: could not convert ‘{0, 0}’ from ‘<brace-enclosed initializer list>’ to ‘plex’
   22 |         plex now=W1,sum={0,0}; int Bc=0;
      |                             ^
      |                             |
      |                             <brace-enclosed initializer list>
answer.code:24:37: error: no match for ‘operator+=’ (operand types are ‘plex’ and ‘plex’)
   24 |                 if (S>>i&1) Bc++,sum+=now;
      |                                  ~~~^~~~~