QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#474048 | #5090. 妙妙题 | bai_hong | Compile Error | / | / | C++14 | 824b | 2024-07-12 15:47:40 | 2024-07-12 15:47:41 |
Judging History
This is the latest submission verdict.
- [2024-07-12 15:47:41]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-07-12 15:47:40]
- Submitted
answer
#include<bits/stdc++.h>
#include "tmp.h"
#define ull unsigned long long
#define zint complex<double>
const double 2Pi=2.0*acos(-1);
const double eps=1e-8;
using namespace std;
inline int read(){
int x=0,f=1; char ch=getchar();
for (;ch<'0'||ch>'9';ch=getchar())
if (ch=='-') f=-1;
for (;ch>='0'&&ch<='9';ch=getchar())
x=(x<<1)+(x<<3)+(ch^48);
return x*f;
}
int n; zint W1;
void init(int N,bool tp,int id){ n=N,W1={cos(2Pi/n),sin(2Pi/n)}; }
int sgn(double x){ x>eps ? 1:x<-eps ? -1:0; }
int Xmul(zint a,zint b){
return sgn(a.real()*b.imag()-b.real*a.imag());
}
bool guess(ull S,int x){
zint now=W1,V={0,0}; int Bc=0;
for (int i=0;i<n-1;i++,now=now*W1)
if (S>>i&1) V+=now,Bc++;
if (!sgn(V.real())&&!sgn(V.imag())) return 0;
int t=Xmul(V,{1,0});
return t<0 ? Bc&1:t>0 ? !(Bc&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:5:14: error: expected unqualified-id before numeric constant 5 | const double 2Pi=2.0*acos(-1); | ^~~ answer.code: In function ‘void init(int, bool, int)’: answer.code:17:46: error: unable to find numeric literal operator ‘operator""Pi’ 17 | void init(int N,bool tp,int id){ n=N,W1={cos(2Pi/n),sin(2Pi/n)}; } | ^~~ answer.code:17:46: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes answer.code:17:57: error: unable to find numeric literal operator ‘operator""Pi’ 17 | void init(int N,bool tp,int id){ n=N,W1={cos(2Pi/n),sin(2Pi/n)}; } | ^~~ answer.code:17:57: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes answer.code:17:63: error: no match for ‘operator=’ (operand types are ‘std::complex<double>’ and ‘<brace-enclosed initializer list>’) 17 | void init(int N,bool tp,int id){ n=N,W1={cos(2Pi/n),sin(2Pi/n)}; } | ^ In file included from /usr/include/c++/13/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:127, from answer.code:1: /usr/include/c++/13/complex:1601:9: note: candidate: ‘template<class _Tp> std::complex<double>& std::complex<double>::operator=(const std::complex<_Tp>&)’ 1601 | operator=(const complex<_Tp>& __z) | ^~~~~~~~ /usr/include/c++/13/complex:1601:9: note: template argument deduction/substitution failed: answer.code:17:63: note: couldn’t deduce template parameter ‘_Tp’ 17 | void init(int N,bool tp,int id){ n=N,W1={cos(2Pi/n),sin(2Pi/n)}; } | ^ /usr/include/c++/13/complex:1560:7: note: candidate: ‘std::complex<double>& std::complex<double>::operator=(double)’ 1560 | operator=(double __d) | ^~~~~~~~ /usr/include/c++/13/complex:1560:24: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘double’ 1560 | operator=(double __d) | ~~~~~~~^~~ /usr/include/c++/13/complex:1596:37: note: candidate: ‘constexpr std::complex<double>& std::complex<double>::operator=(const std::complex<double>&)’ 1596 | _GLIBCXX14_CONSTEXPR complex& operator=(const complex&) = default; | ^~~~~~~~ /usr/include/c++/13/complex:1596:47: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::complex<double>&’ 1596 | _GLIBCXX14_CONSTEXPR complex& operator=(const complex&) = default; | ^~~~~~~~~~~~~~ answer.code: In function ‘int sgn(double)’: answer.code:18:45: warning: no return statement in function returning non-void [-Wreturn-type] 18 | int sgn(double x){ x>eps ? 1:x<-eps ? -1:0; } | ^ answer.code: In function ‘int Xmul(std::complex<double>, std::complex<double>)’: answer.code:20:44: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘double’ to binary ‘operator*’ 20 | return sgn(a.real()*b.imag()-b.real*a.imag()); | ~~~~~~^~~~~~~~~ | | | | | double | <unresolved overloaded function type>