Submission #425438

#TimeUsernameProblemLanguageResultExecution timeMemory
425438errorgornModsum (NOI12_modsum)C++17
25 / 25
78 ms332 KiB
#include <cstdio> using namespace std; int n,arr[1005][2],k; void loop(int i,int v){ if (i==n) { v=(v*v)%5; k+=(((v+2)*v)%5)+1; } else{ for (int x=arr[i][0];x<=arr[i][1];x++){ loop(i+1,(v+x)%5); } } } int main(){ scanf("%d",&n); for (int x=0;x<n;x++){ scanf("%d%d",&arr[x][0],&arr[x][1]); } loop(0,0); printf("%d",k); }

Compilation message (stderr)

modsum.cpp: In function 'int main()':
modsum.cpp:16:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |   scanf("%d",&n);
      |   ~~~~~^~~~~~~~~
modsum.cpp:18:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     scanf("%d%d",&arr[x][0],&arr[x][1]);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...