Submission #974349

# Submission time Handle Problem Language Result Execution time Memory
974349 2024-05-03T09:04:25 Z vjudge1 Savrsen (COCI17_savrsen) C
120 / 120
938 ms 78684 KB
#include<stdio.h>
#include<stdlib.h>
int j,i,a,b;long long z,f[10000001];
int main()
{
    scanf("%d%d",&a,&b);
    for(i=1;i<=b;++i)for(j=i+i;j<=b;j+=i)f[j]+=i;
    for(i=a;i<=b;++i)z+=abs(f[i]-i);
    printf("%lld",z);
}

Compilation message

savrsen.c: In function 'main':
savrsen.c:6:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%d%d",&a,&b);
      |     ^~~~~~~~~~~~~~~~~~~
# 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 2 ms 1116 KB Output is correct
4 Correct 872 ms 78680 KB Output is correct
5 Correct 938 ms 78684 KB Output is correct
6 Correct 877 ms 78684 KB Output is correct
7 Correct 832 ms 73356 KB Output is correct
8 Correct 172 ms 22104 KB Output is correct