| 记录编号 | 595681 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 3149.[CQOI 2007] 余数之和 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.040 s | ||
| 提交时间 | 2024-10-15 20:40:30 | 内存使用 | 3.34 MiB | ||
#include<bits/stdc++.h>
using namespace std;
long long x,y,p,nm,as;
int main(){
freopen("sumd.in","r",stdin);
freopen("sumd.out","w",stdout);
cin>>x>>y;
nm=x*y;
x=min(x,y);
for(int i=1;i<=x;i=p+1){
p=min(x,y/(y/i));
as+=(y/p)*(p+i)*(p-i+1)/2;
}
cout<<nm-as;
return 0;
}