Submission #788750

# Submission time Handle Problem Language Result Execution time Memory
788750 2023-07-20T14:46:04 Z prefixorsuuffiixx Examination (JOI19_examination) C++14
2 / 100
3000 ms 1916 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);

        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

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 time Memory Grader output
1 Correct 1 ms 328 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 320 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 5 ms 468 KB Output is correct
8 Correct 5 ms 468 KB Output is correct
9 Correct 5 ms 468 KB Output is correct
10 Correct 5 ms 340 KB Output is correct
11 Correct 4 ms 340 KB Output is correct
12 Correct 4 ms 336 KB Output is correct
13 Correct 5 ms 468 KB Output is correct
14 Correct 5 ms 452 KB Output is correct
15 Correct 5 ms 460 KB Output is correct
16 Correct 4 ms 336 KB Output is correct
17 Correct 5 ms 332 KB Output is correct
18 Correct 5 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 3050 ms 1916 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3050 ms 1916 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 328 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 320 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 5 ms 468 KB Output is correct
8 Correct 5 ms 468 KB Output is correct
9 Correct 5 ms 468 KB Output is correct
10 Correct 5 ms 340 KB Output is correct
11 Correct 4 ms 340 KB Output is correct
12 Correct 4 ms 336 KB Output is correct
13 Correct 5 ms 468 KB Output is correct
14 Correct 5 ms 452 KB Output is correct
15 Correct 5 ms 460 KB Output is correct
16 Correct 4 ms 336 KB Output is correct
17 Correct 5 ms 332 KB Output is correct
18 Correct 5 ms 340 KB Output is correct
19 Execution timed out 3050 ms 1916 KB Time limit exceeded
20 Halted 0 ms 0 KB -