QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#474016#5090. 妙妙题xbw_________Compile Error//C++141.0kb2024-07-12 15:32:312024-07-12 15:32:31

Judging History

This is the latest submission verdict.

  • [2024-07-12 15:32:31]
  • Judged
  • [2024-07-12 15:32:31]
  • Submitted

answer

#include "tmp.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn=70;
const double pi=3.14159265358979323846,eps=1e-7;
int n;
double x[maxn],y[maxn];
void init(int N,bool Type,int p){
	n=N;
	for(int i=0;i<n;i++){
		x[i]=cos(2.00*i*pi/(1.00*n));
		y[i]=sin(2.00*i*pi/(1.00*n));
		//x是cos y才是sin!!! 
	}
}
bool guess(unsigned long long A,int x){
	//这里我们假设这个人是在(1,0) 
	double vx=0,vy=0; //向量和
	int cnt=0;
	for(int i=0;i<=n-2;i++){
		if(!(A&(1<<i))) continue; //如果这个人是白帽子就滚蛋下一个
		vx+=x[i+1],vy+=y[i+1]; //注意这个人当作第0个 
		cnt^=1;
	} 
	int ans=0;
	if(fabs(vy)>=eps){
		//谁用叉乘判断上下方啊 只要我的纵坐标是0 vy>0/<0/==0秒了 
		//首先假设你知道总黑帽个数 mod2=x
		//那么你看到了mod2=c个帽子,你就要c^x
		//这里x是什么呢,你不知道,所以如果你在向量上方就是0,下方就是1 
 		ans^=(vy>0)^1;
 		return ans^c;
	}
	//如果共线,非0<->1
	return fabs(vx)>=eps;
}

詳細信息

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 function ‘bool guess(long long unsigned int, int)’:
answer.code:22:22: error: invalid types ‘int[int]’ for array subscript
   22 |                 vx+=x[i+1],vy+=y[i+1]; //注意这个人当作第0个
      |                      ^
answer.code:32:28: error: ‘c’ was not declared in this scope
   32 |                 return ans^c;
      |                            ^