Submission #524334

#TimeUsernameProblemLanguageResultExecution timeMemory
524334AzamatRustamovHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
8 / 100
3082 ms6228 KiB
#include <stdio.h> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); int w[n+1]; w[0] = 0; for (int i=1; i<=n; i++) scanf("%d", &w[i]); for (int i=0; i<m; i++) { int l, r, k; scanf("%d %d %d", &l, &r, &k); bool can = 1; for (int i = l; can && i < r; i++) for (int j = i+1; can && j <= r; j++) if (w[i]>w[j] && w[i]+w[j]>k) can = 0; printf("%d\n", can); } return 0; }

Compilation message (stderr)

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%d %d", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~
sortbooks.cpp:12:35: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     for (int i=1; i<=n; i++) scanf("%d", &w[i]);
      |                              ~~~~~^~~~~~~~~~~~~
sortbooks.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%d %d %d", &l, &r, &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...