QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#692275#9246. Dominating PointKeeperHihi#WA 0ms3616kbC++20776b2024-10-31 14:14:572024-10-31 14:14:57

Judging History

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

  • [2024-11-22 18:38:25]
  • hack成功,自动添加数据
  • (/hack/1238)
  • [2024-10-31 14:14:57]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3616kb
  • [2024-10-31 14:14:57]
  • 提交

answer

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

void solve() {
	i64 n;
	cin >> n;
	vector<i64> p;
	for (i64 i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			p.emplace_back(i);
			if (i * i != n) {
				p.emplace_back(n / i);
			}
		}
	}
	sort(p.begin(), p.end());
	int m = p.size();
	unordered_set<long double> set;
	for (int i = 0; i < m; i++) {
		int t = lower_bound(p.begin(), p.end(), p[i] * p[i]) - p.begin();
		for (int j = t; j < m; j++) {
			if (p[j] % p[i] == 0) {
				set.insert(1.L * p[i] * p[i] / p[j]);
			}
		}
	}
	cout << set.size() << "\n";
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int t = 1;
	cin >> t;

	while (t--) {
		solve();
	}

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3616kb

input:

6
011010
000101
010111
100001
010100
100010

output:

41
2
2
5
38
41

result:

wrong answer Integer parameter [name=a] equals to 41, violates the range [1, 6]