Submission #329751

#TimeUsernameProblemLanguageResultExecution timeMemory
329751RainbowbunnyHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
0 / 100
0 ms364 KiB
#include <bits/stdc++.h> using namespace std; int n, m; int w[1000005]; int main() { freopen("Input.txt", "r", stdin); cin >> n >> m; for(int i = 1; i <= n; i++) { cin >> w[i]; } for(int i = 1; i <= m; i++) { int l, r, x; cin >> l >> r >> x; bool ok = true; for(int j = l; j <= r; j++) { for(int k = j + 1; k <= r; k++) { if(w[j] > w[k] and (w[j] + w[k] > x)) { ok = false; } } } if(ok) { cout << 1 << '\n'; } else { cout << 0 << '\n'; } } }

Compilation message (stderr)

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:9:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
    9 |  freopen("Input.txt", "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#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...