답안 #716072

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
716072 2023-03-28T22:08:57 Z bane Examination (JOI19_examination) C++17
2 / 100
3000 ms 1528 KB
#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")     
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:34:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   34 |  scanf("%d%d", &n, &q);
      |  ~~~~~^~~~~~~~~~~~~~~~
examination.cpp:37:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |   scanf("%d%d", &A[i].frs, &A[i].sc);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:40:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   40 |   scanf("%d%d%d", &x, &y, &z);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 1 ms 212 KB Output is correct
7 Correct 8 ms 212 KB Output is correct
8 Correct 8 ms 336 KB Output is correct
9 Correct 8 ms 212 KB Output is correct
10 Correct 8 ms 328 KB Output is correct
11 Correct 8 ms 212 KB Output is correct
12 Correct 8 ms 332 KB Output is correct
13 Correct 8 ms 212 KB Output is correct
14 Correct 8 ms 328 KB Output is correct
15 Correct 11 ms 324 KB Output is correct
16 Correct 10 ms 324 KB Output is correct
17 Correct 8 ms 332 KB Output is correct
18 Correct 8 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3059 ms 1528 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3059 ms 1528 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 1 ms 212 KB Output is correct
7 Correct 8 ms 212 KB Output is correct
8 Correct 8 ms 336 KB Output is correct
9 Correct 8 ms 212 KB Output is correct
10 Correct 8 ms 328 KB Output is correct
11 Correct 8 ms 212 KB Output is correct
12 Correct 8 ms 332 KB Output is correct
13 Correct 8 ms 212 KB Output is correct
14 Correct 8 ms 328 KB Output is correct
15 Correct 11 ms 324 KB Output is correct
16 Correct 10 ms 324 KB Output is correct
17 Correct 8 ms 332 KB Output is correct
18 Correct 8 ms 212 KB Output is correct
19 Execution timed out 3059 ms 1528 KB Time limit exceeded
20 Halted 0 ms 0 KB -