QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#473845 | #5090. 妙妙题 | zyxawa | Compile Error | / | / | C++23 | 477b | 2024-07-12 14:33:46 | 2024-07-12 14:33:47 |
Judging History
This is the latest submission verdict.
- [2024-07-12 14:33:47]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-07-12 14:33:46]
- 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 c){
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;
}
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); | ~~~~~^~~~~~~~~~~ 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:13:57: error: invalid types ‘int[int]’ for array subscript 13 | for(int i=1;i<n;i++) if(a>>(i-1)&1) x+=s[i],y+=c[i]; | ^