QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#476351#5090. 妙妙题liangbowenCompile Error//C++14875b2024-07-13 19:00:522024-07-13 19:00:52

Judging History

This is the latest submission verdict.

  • [2024-07-13 19:00:52]
  • Judged
  • [2024-07-13 19:00:52]
  • Submitted

answer

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <tmp.h>
#define mems(x, v) memset(x, v, sizeof x)
#define mcpy(x, y) memcpy(x, y, sizeof x)
using namespace std;
typedef pair <int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef long double wisdom;

const double pi = acos(-1);
int n; double x[100], y[100];
inline bool is0(double x) {return fabs(x) < 1e-5;}
void init(int _n, bool, int) {n = _n; for (int i = 1; i < n; i++) x[i] = cos(pi * 2 * i / n), y[i] = sin(pi * 2 * i / n);}
bool guess(ull val, int) {
	double sumx = 0, sumy = 0; bool forward = 0;
	for (int i = 1; i < n; i++) if (val & (1ull << (i - 1))) sumx += x[i], sumy += y[i], forward ^= 1;
	if (is0(sumy)) return is0(sumx) ? 0 : 1; //零向量
	return sumy < 0 ? forward : (forward ^ 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:7:10: fatal error: tmp.h: No such file or directory
    7 | #include <tmp.h>
      |          ^~~~~~~
compilation terminated.