QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#473844 | #5090. 妙妙题 | zyxawa | Compile Error | / | / | C++23 | 477b | 2024-07-12 14:33:09 | 2024-07-12 14:33:10 |
Judging History
This is the latest submission verdict.
- [2024-07-12 14:33:10]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-07-12 14:33:09]
- Submitted
answer
#include<bits/stdc++.h>
#include "tmp.h"
using namespace std;
const double pi=acos(-1),eps=1e-8;
double s[65],c[65];
int n;
void init(int m,bool t,int p){
n=m;
for(int i=1;;i<=n;i++) s[i]=sin(2*pi*i/n),c[i]=cos(2*pi*i/n);
}
bool guess(unsigned long long a,int x){
double x=0,y=0;
for(int i=1;i<n;i++) if(a>>(i-1)&1) x+=s[i],y+=c[i];
if(fabs(x)<=eps&&fabs(y)<=eps) return 0;
if((fabs(x-1)<=eps||fabs(x+1)<=eps)&&fabs(y)<=eps) return 1;
return fabs(y)>0;
}
詳細信息
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); | ~~~~~^~~~~~~~~~~ answer.code: In function ‘void init(int, bool, int)’: answer.code:9:26: error: expected ‘)’ before ‘;’ token 9 | for(int i=1;;i<=n;i++) s[i]=sin(2*pi*i/n),c[i]=cos(2*pi*i/n); | ~ ^ | ) answer.code:9:27: error: ‘i’ was not declared in this scope 9 | for(int i=1;;i<=n;i++) s[i]=sin(2*pi*i/n),c[i]=cos(2*pi*i/n); | ^ answer.code: In function ‘bool guess(long long unsigned int, int)’: answer.code:12:16: error: declaration of ‘double x’ shadows a parameter 12 | double x=0,y=0; | ^ answer.code:11:37: note: ‘int x’ previously declared here 11 | bool guess(unsigned long long a,int x){ | ~~~~^