Submission #716071

# Submission time Handle Problem Language Result Execution time Memory
716071 2023-03-28T22:07:45 Z bane Examination (JOI19_examination) C++17
2 / 100
3000 ms 2208 KB
#include <bits/stdc++.h>
       
using namespace std;
       
#ifdef LOCAL
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
       
#define ar array
#define ll long long
#define ld long double
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair
#define frs first
#define sc second
#define eb emplace_back
#define fr(i, n, m) for(int i = (n); i < (m); i ++)     
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;
int dx[4] = {0,0,1,-1};
int dy[4] = {-1,1,0,0};
const int Block = 310;
int n,q;
vector<pair<int,int>>A;
void Examination(){
	scanf("%d%d", &n, &q);
	A.resize(n);
	fr(i, 0, n)
		scanf("%d%d", &A[i].frs, &A[i].sc);
	while(q--){
		int x,y,z;
		scanf("%d%d%d", &x, &y, &z);
		int ans = 0;
		fr(i, 0, n){
			ans+=(A[i].frs >= x) & (A[i].sc >= y) & (A[i].frs + A[i].sc >= z);
		}
		printf("%d\n", ans);
	}
}
       
int main() {
 //   ios_base::sync_with_stdio(0);
 //   cin.tie(0); cout.tie(0);
  //  freopen("art.in", "r", stdin);
  //  freopen("art.out", "w", stdout);
    Examination();
}

Compilation message

examination.cpp: In function 'void Examination()':
examination.cpp:32:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |  scanf("%d%d", &n, &q);
      |  ~~~~~^~~~~~~~~~~~~~~~
examination.cpp:35:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |   scanf("%d%d", &A[i].frs, &A[i].sc);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:38:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   38 |   scanf("%d%d%d", &x, &y, &z);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
7 Correct 14 ms 480 KB Output is correct
8 Correct 16 ms 468 KB Output is correct
9 Correct 19 ms 472 KB Output is correct
10 Correct 16 ms 312 KB Output is correct
11 Correct 14 ms 340 KB Output is correct
12 Correct 13 ms 340 KB Output is correct
13 Correct 15 ms 452 KB Output is correct
14 Correct 14 ms 340 KB Output is correct
15 Correct 14 ms 344 KB Output is correct
16 Correct 14 ms 404 KB Output is correct
17 Correct 16 ms 424 KB Output is correct
18 Correct 16 ms 308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 3050 ms 2208 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3050 ms 2208 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
7 Correct 14 ms 480 KB Output is correct
8 Correct 16 ms 468 KB Output is correct
9 Correct 19 ms 472 KB Output is correct
10 Correct 16 ms 312 KB Output is correct
11 Correct 14 ms 340 KB Output is correct
12 Correct 13 ms 340 KB Output is correct
13 Correct 15 ms 452 KB Output is correct
14 Correct 14 ms 340 KB Output is correct
15 Correct 14 ms 344 KB Output is correct
16 Correct 14 ms 404 KB Output is correct
17 Correct 16 ms 424 KB Output is correct
18 Correct 16 ms 308 KB Output is correct
19 Execution timed out 3050 ms 2208 KB Time limit exceeded
20 Halted 0 ms 0 KB -