Submission #788758

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

Compilation message (stderr)

examination.cpp: In function 'int main()':
examination.cpp:20:14: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   20 |    ans += (x <= a[i] & y <= b[i] & z <= a[i]+b[i]);
      |            ~~^~~~~~~
examination.cpp:20:38: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   20 |    ans += (x <= a[i] & y <= b[i] & z <= a[i]+b[i]);
      |                                    ~~^~~~~~~~~~~~
examination.cpp:13:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |  scanf("%d %d" , &n , &q);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~
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" , &a[i] , &b[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:18:8: 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...