mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 02:28:47 +00:00
[80pts] 1257. [CQOI2007] 余数之和 sum
https://hydro.ac/d/bzoj/record/61e286cf3c2110ae40549b01
This commit is contained in:
parent
3f3a5b9423
commit
840a925ada
18
Hydro/bzoj/1257/1257.cpp
Normal file
18
Hydro/bzoj/1257/1257.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include <cmath>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using std::cin;
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
|
long long n, k, ans;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cin >> n >> k;
|
||||||
|
ans = n * k;
|
||||||
|
for (int x = 1; x <= n; x++) {
|
||||||
|
ans -= floor(1.0 * k / x) * x;
|
||||||
|
}
|
||||||
|
cout << ans << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user