QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#692275 | #9246. Dominating Point | KeeperHihi# | WA | 0ms | 3616kb | C++20 | 776b | 2024-10-31 14:14:57 | 2024-10-31 14:14:57 |
Judging History
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]