Submission #320325

# Submission time Handle Problem Language Result Execution time Memory
320325 2020-11-08T10:04:02 Z rzbt Savrsen (COCI17_savrsen) C++14
120 / 120
1313 ms 39532 KB
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define MAXN 10000005
typedef long long ll;

int eratosten[MAXN];
int zbir[MAXN];

using namespace std;

int a,b;

int main()
{
    scanf("%d %d", &a, &b);
    for(int i=1;i<MAXN;i++){
        for(int j=i+i;j<MAXN;j+=i){
            zbir[j]+=i;
        }
    }
    ll res=0;

    for(;a<=b;a++){


        res+=abs(a-zbir[a]);
    }
    printf("%lld",res);

    return 0;
}

Compilation message

savrsen.cpp: In function 'int main()':
savrsen.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   19 |     scanf("%d %d", &a, &b);
      |     ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1286 ms 39524 KB Output is correct
2 Correct 1287 ms 39512 KB Output is correct
3 Correct 1284 ms 39524 KB Output is correct
4 Correct 1313 ms 39396 KB Output is correct
5 Correct 1301 ms 39524 KB Output is correct
6 Correct 1301 ms 39520 KB Output is correct
7 Correct 1305 ms 39524 KB Output is correct
8 Correct 1303 ms 39532 KB Output is correct