Submission #788750

#TimeUsernameProblemLanguageResultExecution timeMemory
788750prefixorsuuffiixxExamination (JOI19_examination)C++14
2 / 100
3050 ms1916 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 main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); scanf("%d %d" , &n , &m); int a[n],b[n]; 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:19:53: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   19 |             for (int i = 0; i < n; i++)ans += (a[i] >= x & b[i] >= y & a[i]+b[i]>=z);
      |                                                ~~~~~^~~~
examination.cpp:19:81: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   19 |             for (int i = 0; i < n; i++)ans += (a[i] >= x & b[i] >= y & a[i]+b[i]>=z);
      |                                                                        ~~~~~~~~~^~~
examination.cpp:20:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   20 |             printf("%d\n" , ans);
      |                     ~^      ~~~
      |                      |      |
      |                      int    long long int
      |                     %lld
examination.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf("%d %d" , &n , &m);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~
examination.cpp:15:37: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |         for (int i = 0;i<n;i++)scanf("%d %d" , &a[i] , &b[i]);
      |                                ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:18:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |             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...