Submission #974345

# Submission time Handle Problem Language Result Execution time Memory
974345 2024-05-03T08:59:18 Z sleepntsheep Savrsen (COCI17_savrsen) C
120 / 120
969 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 1 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 963 ms 78672 KB Output is correct
5 Correct 969 ms 78680 KB Output is correct
6 Correct 938 ms 78684 KB Output is correct
7 Correct 862 ms 73360 KB Output is correct
8 Correct 160 ms 21848 KB Output is correct