답안 #788720

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
788720 2023-07-20T14:19:34 Z prefixorsuuffiixx Examination (JOI19_examination) C++14
100 / 100
2248 ms 6524 KB
    #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[100001],b[100001];
    int main() {
        ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
        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);
            cout << ans << '\n';
        }
    }

Compilation message

examination.cpp: In function 'int main()':
examination.cpp:17:53: 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:81: 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:12:14: 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:37: 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:18: 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);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 4 ms 340 KB Output is correct
8 Correct 3 ms 340 KB Output is correct
9 Correct 3 ms 340 KB Output is correct
10 Correct 3 ms 340 KB Output is correct
11 Correct 4 ms 340 KB Output is correct
12 Correct 3 ms 340 KB Output is correct
13 Correct 4 ms 340 KB Output is correct
14 Correct 4 ms 340 KB Output is correct
15 Correct 4 ms 340 KB Output is correct
16 Correct 4 ms 340 KB Output is correct
17 Correct 3 ms 364 KB Output is correct
18 Correct 3 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2171 ms 1592 KB Output is correct
2 Correct 2115 ms 1732 KB Output is correct
3 Correct 2137 ms 1616 KB Output is correct
4 Correct 2131 ms 1576 KB Output is correct
5 Correct 2103 ms 3328 KB Output is correct
6 Correct 2171 ms 2628 KB Output is correct
7 Correct 2135 ms 4080 KB Output is correct
8 Correct 2159 ms 4076 KB Output is correct
9 Correct 2248 ms 3952 KB Output is correct
10 Correct 2080 ms 3368 KB Output is correct
11 Correct 2157 ms 3256 KB Output is correct
12 Correct 2108 ms 2372 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2171 ms 1592 KB Output is correct
2 Correct 2115 ms 1732 KB Output is correct
3 Correct 2137 ms 1616 KB Output is correct
4 Correct 2131 ms 1576 KB Output is correct
5 Correct 2103 ms 3328 KB Output is correct
6 Correct 2171 ms 2628 KB Output is correct
7 Correct 2135 ms 4080 KB Output is correct
8 Correct 2159 ms 4076 KB Output is correct
9 Correct 2248 ms 3952 KB Output is correct
10 Correct 2080 ms 3368 KB Output is correct
11 Correct 2157 ms 3256 KB Output is correct
12 Correct 2108 ms 2372 KB Output is correct
13 Correct 2102 ms 4628 KB Output is correct
14 Correct 2088 ms 4432 KB Output is correct
15 Correct 2115 ms 4120 KB Output is correct
16 Correct 2114 ms 3848 KB Output is correct
17 Correct 2077 ms 3764 KB Output is correct
18 Correct 2209 ms 2676 KB Output is correct
19 Correct 2159 ms 4540 KB Output is correct
20 Correct 2195 ms 4508 KB Output is correct
21 Correct 2158 ms 4500 KB Output is correct
22 Correct 2191 ms 3116 KB Output is correct
23 Correct 2142 ms 3416 KB Output is correct
24 Correct 2105 ms 2304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 4 ms 340 KB Output is correct
8 Correct 3 ms 340 KB Output is correct
9 Correct 3 ms 340 KB Output is correct
10 Correct 3 ms 340 KB Output is correct
11 Correct 4 ms 340 KB Output is correct
12 Correct 3 ms 340 KB Output is correct
13 Correct 4 ms 340 KB Output is correct
14 Correct 4 ms 340 KB Output is correct
15 Correct 4 ms 340 KB Output is correct
16 Correct 4 ms 340 KB Output is correct
17 Correct 3 ms 364 KB Output is correct
18 Correct 3 ms 340 KB Output is correct
19 Correct 2171 ms 1592 KB Output is correct
20 Correct 2115 ms 1732 KB Output is correct
21 Correct 2137 ms 1616 KB Output is correct
22 Correct 2131 ms 1576 KB Output is correct
23 Correct 2103 ms 3328 KB Output is correct
24 Correct 2171 ms 2628 KB Output is correct
25 Correct 2135 ms 4080 KB Output is correct
26 Correct 2159 ms 4076 KB Output is correct
27 Correct 2248 ms 3952 KB Output is correct
28 Correct 2080 ms 3368 KB Output is correct
29 Correct 2157 ms 3256 KB Output is correct
30 Correct 2108 ms 2372 KB Output is correct
31 Correct 2102 ms 4628 KB Output is correct
32 Correct 2088 ms 4432 KB Output is correct
33 Correct 2115 ms 4120 KB Output is correct
34 Correct 2114 ms 3848 KB Output is correct
35 Correct 2077 ms 3764 KB Output is correct
36 Correct 2209 ms 2676 KB Output is correct
37 Correct 2159 ms 4540 KB Output is correct
38 Correct 2195 ms 4508 KB Output is correct
39 Correct 2158 ms 4500 KB Output is correct
40 Correct 2191 ms 3116 KB Output is correct
41 Correct 2142 ms 3416 KB Output is correct
42 Correct 2105 ms 2304 KB Output is correct
43 Correct 2180 ms 6492 KB Output is correct
44 Correct 2103 ms 6524 KB Output is correct
45 Correct 2159 ms 6472 KB Output is correct
46 Correct 2167 ms 5068 KB Output is correct
47 Correct 2184 ms 5024 KB Output is correct
48 Correct 2107 ms 2560 KB Output is correct
49 Correct 2200 ms 6344 KB Output is correct
50 Correct 2121 ms 6428 KB Output is correct
51 Correct 2114 ms 6388 KB Output is correct
52 Correct 2101 ms 4776 KB Output is correct
53 Correct 2073 ms 3928 KB Output is correct