Submission #884407

# Submission time Handle Problem Language Result Execution time Memory
884407 2023-12-07T09:54:24 Z gutzzy Savrsen (COCI17_savrsen) C++14
30 / 120
3000 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

int f(int n){
    if(n==1) return 1;
    int 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;
    int 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 1 ms 348 KB Output is correct
3 Incorrect 128 ms 344 KB Output isn't correct
4 Incorrect 20 ms 344 KB Output isn't correct
5 Execution timed out 3024 ms 344 KB Time limit exceeded
6 Execution timed out 3037 ms 344 KB Time limit exceeded
7 Execution timed out 3058 ms 348 KB Time limit exceeded
8 Execution timed out 3047 ms 348 KB Time limit exceeded