Submission #788744

# Submission time Handle Problem Language Result Execution time Memory
788744 2023-07-20T14:43:22 Z prefixorsuuffiixx Examination (JOI19_examination) C++14
100 / 100
2236 ms 2204 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 main() {
        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
        int a[100000],b[100000];
        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

examination.cpp: In function 'int main()':
examination.cpp:18:53: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   18 |             for (int i = 0; i < n; i++)ans += (a[i] >= x & b[i] >= y & a[i]+b[i]>=z);
      |                                                ~~~~~^~~~
examination.cpp:18:81: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   18 |             for (int i = 0; i < n; i++)ans += (a[i] >= x & b[i] >= y & a[i]+b[i]>=z);
      |                                                                        ~~~~~~~~~^~~
examination.cpp:19:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   19 |             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:14:37: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         for (int i = 0;i<n;i++)scanf("%d %d" , &a[i] , &b[i]);
      |                                ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:17:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |             scanf("%d %d %d" , &x , &y , &z);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1108 KB Output is correct
2 Correct 1 ms 1108 KB Output is correct
3 Correct 1 ms 1108 KB Output is correct
4 Correct 1 ms 1108 KB Output is correct
5 Correct 1 ms 1108 KB Output is correct
6 Correct 1 ms 980 KB Output is correct
7 Correct 4 ms 1208 KB Output is correct
8 Correct 5 ms 1240 KB Output is correct
9 Correct 6 ms 1240 KB Output is correct
10 Correct 6 ms 1204 KB Output is correct
11 Correct 6 ms 1204 KB Output is correct
12 Correct 4 ms 1108 KB Output is correct
13 Correct 4 ms 1236 KB Output is correct
14 Correct 4 ms 1236 KB Output is correct
15 Correct 5 ms 1220 KB Output is correct
16 Correct 4 ms 1108 KB Output is correct
17 Correct 4 ms 1108 KB Output is correct
18 Correct 4 ms 1108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2213 ms 2056 KB Output is correct
2 Correct 2178 ms 2156 KB Output is correct
3 Correct 2236 ms 2000 KB Output is correct
4 Correct 2117 ms 2128 KB Output is correct
5 Correct 2160 ms 1964 KB Output is correct
6 Correct 2097 ms 2156 KB Output is correct
7 Correct 2112 ms 2040 KB Output is correct
8 Correct 2116 ms 2204 KB Output is correct
9 Correct 2080 ms 2056 KB Output is correct
10 Correct 2119 ms 1740 KB Output is correct
11 Correct 2189 ms 1984 KB Output is correct
12 Correct 2166 ms 1696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2213 ms 2056 KB Output is correct
2 Correct 2178 ms 2156 KB Output is correct
3 Correct 2236 ms 2000 KB Output is correct
4 Correct 2117 ms 2128 KB Output is correct
5 Correct 2160 ms 1964 KB Output is correct
6 Correct 2097 ms 2156 KB Output is correct
7 Correct 2112 ms 2040 KB Output is correct
8 Correct 2116 ms 2204 KB Output is correct
9 Correct 2080 ms 2056 KB Output is correct
10 Correct 2119 ms 1740 KB Output is correct
11 Correct 2189 ms 1984 KB Output is correct
12 Correct 2166 ms 1696 KB Output is correct
13 Correct 2144 ms 1988 KB Output is correct
14 Correct 2129 ms 2028 KB Output is correct
15 Correct 2133 ms 1996 KB Output is correct
16 Correct 2113 ms 2004 KB Output is correct
17 Correct 2226 ms 2092 KB Output is correct
18 Correct 2199 ms 2164 KB Output is correct
19 Correct 2130 ms 1980 KB Output is correct
20 Correct 2118 ms 2032 KB Output is correct
21 Correct 2137 ms 1992 KB Output is correct
22 Correct 2181 ms 1840 KB Output is correct
23 Correct 2104 ms 1872 KB Output is correct
24 Correct 2155 ms 1608 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1108 KB Output is correct
2 Correct 1 ms 1108 KB Output is correct
3 Correct 1 ms 1108 KB Output is correct
4 Correct 1 ms 1108 KB Output is correct
5 Correct 1 ms 1108 KB Output is correct
6 Correct 1 ms 980 KB Output is correct
7 Correct 4 ms 1208 KB Output is correct
8 Correct 5 ms 1240 KB Output is correct
9 Correct 6 ms 1240 KB Output is correct
10 Correct 6 ms 1204 KB Output is correct
11 Correct 6 ms 1204 KB Output is correct
12 Correct 4 ms 1108 KB Output is correct
13 Correct 4 ms 1236 KB Output is correct
14 Correct 4 ms 1236 KB Output is correct
15 Correct 5 ms 1220 KB Output is correct
16 Correct 4 ms 1108 KB Output is correct
17 Correct 4 ms 1108 KB Output is correct
18 Correct 4 ms 1108 KB Output is correct
19 Correct 2213 ms 2056 KB Output is correct
20 Correct 2178 ms 2156 KB Output is correct
21 Correct 2236 ms 2000 KB Output is correct
22 Correct 2117 ms 2128 KB Output is correct
23 Correct 2160 ms 1964 KB Output is correct
24 Correct 2097 ms 2156 KB Output is correct
25 Correct 2112 ms 2040 KB Output is correct
26 Correct 2116 ms 2204 KB Output is correct
27 Correct 2080 ms 2056 KB Output is correct
28 Correct 2119 ms 1740 KB Output is correct
29 Correct 2189 ms 1984 KB Output is correct
30 Correct 2166 ms 1696 KB Output is correct
31 Correct 2144 ms 1988 KB Output is correct
32 Correct 2129 ms 2028 KB Output is correct
33 Correct 2133 ms 1996 KB Output is correct
34 Correct 2113 ms 2004 KB Output is correct
35 Correct 2226 ms 2092 KB Output is correct
36 Correct 2199 ms 2164 KB Output is correct
37 Correct 2130 ms 1980 KB Output is correct
38 Correct 2118 ms 2032 KB Output is correct
39 Correct 2137 ms 1992 KB Output is correct
40 Correct 2181 ms 1840 KB Output is correct
41 Correct 2104 ms 1872 KB Output is correct
42 Correct 2155 ms 1608 KB Output is correct
43 Correct 2099 ms 2036 KB Output is correct
44 Correct 2118 ms 1988 KB Output is correct
45 Correct 2163 ms 2032 KB Output is correct
46 Correct 2100 ms 1908 KB Output is correct
47 Correct 2094 ms 2020 KB Output is correct
48 Correct 2108 ms 1796 KB Output is correct
49 Correct 2113 ms 1988 KB Output is correct
50 Correct 2175 ms 2108 KB Output is correct
51 Correct 2142 ms 2028 KB Output is correct
52 Correct 2132 ms 1748 KB Output is correct
53 Correct 2132 ms 1808 KB Output is correct