Submission #211766

#TimeUsernameProblemLanguageResultExecution timeMemory
211766goodboyPotatoes and fertilizers (LMIO19_bulves)C++14
0 / 100
158 ms7064 KiB
#include <stdio.h> #include <math.h> using namespace std; int main() { int n , a , b , prefix = 0; scanf("%d",&n); long long ans = 0; for (int i = 1; i <= n; i++) { scanf("%d%d",&a,&b); prefix += (a-b); ans += abs(prefix); } printf("%lld\n",ans); return 0; }

Compilation message (stderr)

bulves.cpp: In function 'int main()':
bulves.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
bulves.cpp:10:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
      scanf("%d%d",&a,&b);
      ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...