Submission #524858

#TimeUsernameProblemLanguageResultExecution timeMemory
524858veosHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++11
8 / 100
3056 ms12636 KiB
#include <stdio.h> using namespace std; int main(){ int m,n; scanf("%d %d",&n,&m); int b[n+1]; b[0]=0; for(int i=1;i<=n;i++) scanf("%d",&b[i]); p: int l,r,k; bool g=true; scanf("%d",&l); scanf("%d",&r); scanf("%d",&k); for(int i=l;g&&i<r;i++){ for(int j=i+1;g&&j<=r;j++){ if(b[i]>b[j]&&k<b[i]+b[j]){ g=false; printf("%d\n",0);} } } m--; if(g==true) printf("%d\n",1); if(m>0){ goto p; } } //Matchanov Muxammad

Compilation message (stderr)

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:5:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |  scanf("%d %d",&n,&m);
      |  ~~~~~^~~~~~~~~~~~~~~
sortbooks.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |   scanf("%d",&b[i]);
      |   ~~~~~^~~~~~~~~~~~
sortbooks.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d",&l);
      |   ~~~~~^~~~~~~~~
sortbooks.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |   scanf("%d",&r);
      |   ~~~~~^~~~~~~~~
sortbooks.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%d",&k);
      |   ~~~~~^~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...