# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
884409 |
2023-12-07T09:56:17 Z |
gutzzy |
Savrsen (COCI17_savrsen) |
C++14 |
|
3000 ms |
408 KB |
#include <bits/stdc++.h>
using namespace std;
long long f(int n){
if(n==1) return 1;
long long ans = n;
for(int i=1;i<=sqrt(n);i++){
if(n%i==0){
ans -= i;
if(i!=1 and i*i!=n){
ans -= (n/i);
}
}
}
return abs(ans);
}
int main(){
int a,b;
cin >> a >> b;
long long ans = 0;
for(int i=a;i<=b;i++){
ans += f(i);
}
cout << ans << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
129 ms |
408 KB |
Output is correct |
4 |
Correct |
20 ms |
348 KB |
Output is correct |
5 |
Execution timed out |
3066 ms |
348 KB |
Time limit exceeded |
6 |
Execution timed out |
3053 ms |
348 KB |
Time limit exceeded |
7 |
Execution timed out |
3067 ms |
348 KB |
Time limit exceeded |
8 |
Execution timed out |
3039 ms |
348 KB |
Time limit exceeded |