提交记录 14297
| 用户 |
题目 |
状态 |
得分 |
用时 |
内存 |
语言 |
代码长度 |
| a_night |
test. 自定义测试 |
Time Limit Exceeded |
0 |
1 s |
4236 KB |
C++11 |
772 B |
| 提交时间 |
评测时间 |
| 2020-09-20 15:06:39 |
2023-09-03 19:41:17 |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5+10;
int V[maxn];
map<int, ll>S;
ll Sum(ll n)
{
int m = (int)sqrt(n);
int t = n / m;
for(int i = 1;i <= m;i++) V[i-1] = n / i;
int cnt = 1;
for(int i = t + m - 2;i >= m;i--) V[i] = cnt++;
for(int i = 0;i <= t+m-2;i++) S[V[i]] = 1LL * V[i] * (V[i]+1) / 2 - 1;
for(int p = 2;p <= m;p++)
{
if(S[p] > S[p-1])
{
ll sp = S[p-1];
ll p2 = p * p;
for(int i = 0;i <= t+m-2;i++)
{
ll v = V[i];
if(v < p2) break;
S[v] -= p*(S[v/p] - sp);
}
}
}
return S[n];
}
int main()
{
printf("%lld\n", Sum(1000000000));
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 1 s | 4 MB + 140 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-03-22 18:48:46 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠