Submission #974343

# Submission time Handle Problem Language Result Execution time Memory
974343 2024-05-03T08:57:24 Z sleepntsheep Savrsen (COCI17_savrsen) C
30 / 120
801 ms 39760 KB
#include<stdio.h>
#include<stdlib.h>
int z,j,i,a,b,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("%d",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 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 604 KB Output isn't correct
4 Incorrect 755 ms 39532 KB Output isn't correct
5 Incorrect 801 ms 39536 KB Output isn't correct
6 Incorrect 745 ms 39760 KB Output isn't correct
7 Incorrect 711 ms 38496 KB Output isn't correct
8 Incorrect 74 ms 11800 KB Output isn't correct