Submission #322380

# Submission time Handle Problem Language Result Execution time Memory
322380 2020-11-14T14:37:57 Z fgojko Savrsen (COCI17_savrsen) C++14
30 / 120
1320 ms 39616 KB
#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    vector<int> vec(b+1, 1);
    vec[1] = 0;
    for(int i = 2; i <= b/2+1; ++i){
        for(int j = i*2; j <= b; j += i){
            vec[j] += i;
        }
    }
    int sum = 0;
    for(int i = a; i <= b; ++i){
        sum += abs(vec[i] - i);
    }
    cout << sum << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 364 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Incorrect 2 ms 748 KB Output isn't correct
4 Incorrect 1307 ms 39404 KB Output isn't correct
5 Incorrect 1308 ms 39508 KB Output isn't correct
6 Incorrect 1320 ms 39616 KB Output isn't correct
7 Incorrect 1195 ms 36460 KB Output isn't correct
8 Incorrect 229 ms 10448 KB Output isn't correct