제출 #772968

#제출 시각아이디문제언어결과실행 시간메모리
772968BlagojExamination (JOI19_examination)C++17
2 / 100
3055 ms2504 KiB
#include <bits/stdc++.h>

#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif

#pragma GCC optimize("Ofast,unroll-loops")

using namespace std;

#define endl '\n'
#define ll long long
#define all(x) x.begin(), x.end()

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, q;
    cin >> n >> q;
    int a[n], b[n];
    for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
    while (q--) {
        int x, y, z, ans = 0;
        cin >> x >> y >> z;
        for (int i = 0; i < n; i++) ans += (a[i] >= x & b[i] >= y & a[i] + b[i] >= z);
        cout << ans << endl;
    }
}

컴파일 시 표준 에러 (stderr) 메시지

examination.cpp: In function 'int main()':
examination.cpp:27:50: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   27 |         for (int i = 0; i < n; i++) ans += (a[i] >= x & b[i] >= y & a[i] + b[i] >= z);
      |                                             ~~~~~^~~~
examination.cpp:27:81: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   27 |         for (int i = 0; i < n; i++) ans += (a[i] >= x & b[i] >= y & a[i] + b[i] >= 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...