Submission #147590

# Submission time Handle Problem Language Result Execution time Memory
147590 2019-08-30T07:55:59 Z nicolaalexandra Savrsen (COCI17_savrsen) C++14
30 / 120
1548 ms 39544 KB
#include <iostream>
#define DIM 10000010
using namespace std;
int i,j,a,b,sol;
int d[DIM];
int main (){

    for (i=2;i<DIM/2;i++){
        for (j=i+i;j<DIM;j+=i)
            d[j] += i;
    }

    cin>>a>>b;
    for (i=a;i<=b;i++){
        if (i == 1)
            sol++;
        else sol += max (i-d[i]-1,1+d[i]-i);
    }
    cout<<sol;


    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1409 ms 39488 KB Output is correct
2 Correct 1423 ms 39544 KB Output is correct
3 Incorrect 1404 ms 39484 KB Output isn't correct
4 Incorrect 1504 ms 39492 KB Output isn't correct
5 Incorrect 1548 ms 39488 KB Output isn't correct
6 Incorrect 1497 ms 39544 KB Output isn't correct
7 Incorrect 1548 ms 39544 KB Output isn't correct
8 Incorrect 1399 ms 39528 KB Output isn't correct