#include <bits/stdc++.h>
#define GLHF ios_base::sync_with_stdio(0); cin.tie(), cout.tie();
#define GGWP return 0;
#define ALTF4 exit(0)
#define GCWS/*Good Contest, Well Solved*/ ALTF4
#define ull unsigned long long
#define ll long long
#define ld long double
#define fxr1(x) for(int I = 0; I < x; ++I)
#define fxr(x) for(int I = 0; I <= x; ++I)
#define F first
#define S second
using namespace std;
int a, b, ans;
int main()
{
GLHF
cin >> a >> b;
for ( int I = a; I <= b; ++I )
{
int cnt = I;
for ( int J = 1; J <= I/2; ++J )
{
if ( I % J == 0 )
cnt -= J;
}
ans += abs(cnt);
}
cout << ans << endl;
GGWP
}
//clang++ -v -std=c++11 finish fishing the fish.people
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
4 ms |
500 KB |
Output is correct |
3 |
Execution timed out |
3033 ms |
500 KB |
Time limit exceeded |
4 |
Execution timed out |
3038 ms |
500 KB |
Time limit exceeded |
5 |
Execution timed out |
3059 ms |
500 KB |
Time limit exceeded |
6 |
Execution timed out |
3043 ms |
500 KB |
Time limit exceeded |
7 |
Execution timed out |
3011 ms |
520 KB |
Time limit exceeded |
8 |
Execution timed out |
3059 ms |
532 KB |
Time limit exceeded |