QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#474303#5090. 妙妙题WRuperDCompile Error//C++14666b2024-07-12 17:15:522024-07-12 17:15:53

Judging History

This is the latest submission verdict.

  • [2024-07-12 17:15:53]
  • Judged
  • [2024-07-12 17:15:52]
  • Submitted

answer

// Problem: # 5090. 妙妙题
// URL: https://qoj.ac/problem/5090
// Written by WRuperD

#include<bits/stdc++.h>
using namespace std;

const double pi = acos(-1), eps 1e-7;
const int MAX = 100;
int n;
int x[MAX], y[MAX];

void init (int N, bool Type, int p){
	n = N;
	for(int i = 1; i <= n; i++){
		x[i] = cos(2.0 * pi * i / n);
		y[i] = sin(2.0 * pi * i / n);
	}
}

bool guess (unsigned long long A, int x){
	double nx = 0, ny = 0;
	bool now = 0;
	for(int i = 1; i <= n;  i++){
		if(A & (1ll << (i -  1))){
			nx += x[i], ny += y[i];
			now ^= 1;
		}
	}
	if(fabs(ny) > eps)	return now ^ (ny > 0);
	if(fabs(nx))	return 0;
	return 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:8:33: error: expected initializer before numeric constant
    8 | const double pi = acos(-1), eps 1e-7;
      |                                 ^~~~
answer.code: In function ‘bool guess(long long unsigned int, int)’:
answer.code:26:32: error: invalid types ‘int[int]’ for array subscript
   26 |                         nx += x[i], ny += y[i];
      |                                ^
answer.code:30:23: error: ‘eps’ was not declared in this scope
   30 |         if(fabs(ny) > eps)      return now ^ (ny > 0);
      |                       ^~~