Submission #126805

# Submission time Handle Problem Language Result Execution time Memory
126805 2019-07-08T12:51:23 Z MohamedAhmed04 Examination (JOI19_examination) C++14
2 / 100
3000 ms 2292 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n , q ;
    scanf("%d %d" , &n , &q) ;
    int a[n] , b[n] ;
    for(int i = 0 ; i < n ; ++i)
        scanf("%d %d" , &a[i] , &b[i]) ;
    while(q--)
    {
        int x , y , z ;
        scanf("%d %d %d" , &x , &y , &z) ;
        int ans = 0 ;
        for(int i = 0 ; i < n ; ++i)
        {
            if(a[i] >= x && b[i] >= y && a[i] + b[i] >= z)
                ans++ ;
        }
        printf("%d\n" , ans) ;
    }
    return 0 ;
}

Compilation message

examination.cpp: In function 'int main()':
examination.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d" , &n , &q) ;
     ~~~~~^~~~~~~~~~~~~~~~~~~
examination.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d" , &a[i] , &b[i]) ;
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d %d" , &x , &y , &z) ;
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 360 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 53 ms 504 KB Output is correct
8 Correct 53 ms 504 KB Output is correct
9 Correct 54 ms 660 KB Output is correct
10 Correct 52 ms 632 KB Output is correct
11 Correct 54 ms 504 KB Output is correct
12 Correct 53 ms 376 KB Output is correct
13 Correct 52 ms 504 KB Output is correct
14 Correct 52 ms 504 KB Output is correct
15 Correct 52 ms 524 KB Output is correct
16 Correct 26 ms 376 KB Output is correct
17 Correct 45 ms 376 KB Output is correct
18 Correct 12 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 3028 ms 2292 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3028 ms 2292 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 360 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 53 ms 504 KB Output is correct
8 Correct 53 ms 504 KB Output is correct
9 Correct 54 ms 660 KB Output is correct
10 Correct 52 ms 632 KB Output is correct
11 Correct 54 ms 504 KB Output is correct
12 Correct 53 ms 376 KB Output is correct
13 Correct 52 ms 504 KB Output is correct
14 Correct 52 ms 504 KB Output is correct
15 Correct 52 ms 524 KB Output is correct
16 Correct 26 ms 376 KB Output is correct
17 Correct 45 ms 376 KB Output is correct
18 Correct 12 ms 376 KB Output is correct
19 Execution timed out 3028 ms 2292 KB Time limit exceeded
20 Halted 0 ms 0 KB -