Submission #788729

#TimeUsernameProblemLanguageResultExecution timeMemory
788729prefixorsuuffiixxExamination (JOI19_examination)C++14
100 / 100
2244 ms1908 KiB
#include <iostream> #pragma GCC target ("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("Ofast,unroll-loops") using namespace std; long long ans; int x,y,z; int n,m; int a[100000],b[100000]; int main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); scanf("%d %d" , &n , &m); for (int i = 0;i<n;i++)scanf("%d %d" , &a[i] , &b[i]); while(m--){ ans = 0; scanf("%d %d %d" , &x , &y , &z); for (int i = 0; i < n; i++)ans += (a[i] >= x & b[i] >= y & a[i]+b[i]>=z); printf("%d\n" , ans); } }

Compilation message (stderr)

examination.cpp: In function 'int main()':
examination.cpp:17:49: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   17 |         for (int i = 0; i < n; i++)ans += (a[i] >= x & b[i] >= y & a[i]+b[i]>=z);
      |                                            ~~~~~^~~~
examination.cpp:17:77: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   17 |         for (int i = 0; i < n; i++)ans += (a[i] >= x & b[i] >= y & a[i]+b[i]>=z);
      |                                                                    ~~~~~~~~~^~~
examination.cpp:18:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   18 |         printf("%d\n" , ans);
      |                 ~^      ~~~
      |                  |      |
      |                  int    long long int
      |                 %lld
examination.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d %d" , &n , &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
examination.cpp:13:33: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     for (int i = 0;i<n;i++)scanf("%d %d" , &a[i] , &b[i]);
      |                            ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
examination.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" , &x , &y , &z);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...