QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#637191 | #9248. An Easy Math Problem | blue_sky# | TL | 0ms | 3596kb | C++20 | 1.2kb | 2024-10-13 10:52:34 | 2024-10-13 10:52:35 |
Judging History
This is the latest submission verdict.
- [2024-10-31 22:36:43]
- hack成功,自动添加数据
- (/hack/1098)
- [2024-10-31 22:13:58]
- hack成功,自动添加数据
- (/hack/1096)
- [2024-10-31 22:00:43]
- hack成功,自动添加数据
- (/hack/1095)
- [2024-10-13 10:52:34]
- Submitted
answer
#include <bits/stdc++.h>
#define int long long
#define x first
#define y second
#define bug(X) cout << "bug:# " << X << endl
#define bug2(f, X) cout << "bug:# " << f << " " << X << endl
#define bug3(i, j, G) cout << "bug:# " << i << ' ' << j << ' ' << G << endl
#define endl '\n'
using namespace std;
const int mod = 1e11 + 3;
const int N = 10 + 5e5;
void _();
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
cin >> t;
while (t--)
_();
return 0;
}
void _()
{
int n;
cin >> n;
int cnt = 0;
vector<int> yin;
map<pair<int, int>, int> res;
for (int i = 1; i <= n / i; i++)
if (n % i == 0)
{
yin.push_back(i);
if (n / i - i)
yin.push_back(n / i);
res[{1, i}]++;
res[{1, n / i}]++;
}
for (auto v : yin)
{
for (int i = 2; i <= n / i; i++)
if (v % i == 0)
{
int g = __gcd(i, v / i);
if (i <= v / i)
res[{i / g, v / i / g}]++;
}
}
// for (auto [V, _] : res)
// bug2(V.x, V.y);
cout << res.size() << endl;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3596kb
input:
10 1 2 3 4 5 6 7 8 9 10
output:
1 2 2 3 2 5 2 4 3 5
result:
ok 10 lines
Test #2:
score: -100
Time Limit Exceeded
input:
2000 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 6469693230 646969323...