Submission #974345

#TimeUsernameProblemLanguageResultExecution timeMemory
974345sleepntsheepSavrsen (COCI17_savrsen)C11
120 / 120
969 ms78684 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...