Submission #274031

#TimeUsernameProblemLanguageResultExecution timeMemory
274031HalitExamination (JOI19_examination)C++17
2 / 100
3080 ms2820 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,q,mat,in,s; scanf("%d %d", &n, &q); vector<pair<int, int> > v; for(int i = 0;i < n;++i){ scanf("%d %d", &mat, &in); v.emplace_back(mat, in); } while(q--){ scanf("%d %d %d", &mat, &in, &s); int ans = 0; for(int i = 0;i < n;++i) ans += (v[i].first >= mat) && (v[i].second >= in) && (v[i].first + v[i].second >= s); printf("%d\n", ans); } }

Compilation message (stderr)

examination.cpp: In function 'int main()':
examination.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    6 |  scanf("%d %d", &n, &q);
      |  ~~~~~^~~~~~~~~~~~~~~~~
examination.cpp:10:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |   scanf("%d %d", &mat, &in);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~
examination.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   15 |   scanf("%d %d %d", &mat, &in, &s);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...