QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#490178#9156. 百万富翁strcspnCompile Error//C++14897b2024-07-25 12:31:442024-07-25 12:31:44

Judging History

你现在查看的是最新测评结果

  • [2024-07-25 12:31:44]
  • 评测
  • [2024-07-25 12:31:44]
  • 提交

answer

#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
#include "richest.h"
#define rep(i, a, b) for(int i = a; i <= b; i++)
using vec = vector<int>;
using ll = long long int;
constexpr int maxn = 2e6 + 10;
#define ps push_back
int p[35] = { 500000, 250000, 125000, 62500, 31250, 15625, 5209, 882, 47, 1 }, cnt[maxn];
int richest(int n, int t, int s) {
	vec a; 
	for (int i = 0; i < n; i++) a.push_back(i);
	for (int i = 0; i < min(10, t); i++) {
		vec x, y;
		for (int j = 0; j < a.size(); j++) {
			for (int k = j % p[i]; k < j; k += p[i]) if (j != k) x.ps(a[j]), y.ps(a[k]);
		}
		vec z = ask(x, y), na;
		for (int j = 0; j < z.size(); j++) z[j] == x[j] ? ++cnt[y[j]] : ++cnt[x[j]];
		for (int j = 0; j < a.size(); j++) if (!cnt[a[j]]) na.ps(a[j]);
		for (int j = 0; j < z.size(); j++) z[j] == x[j] ? --cnt[y[j]] : --cnt[x[j]];
		a = na; 
	}
	return a[0];
}

Details

answer.code:2:10: fatal error: windows.h: No such file or directory
    2 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.