Submission #998238

# Submission time Handle Problem Language Result Execution time Memory
998238 2024-06-13T12:19:55 Z cowwycow Examination (JOI19_examination) C++14
2 / 100
3000 ms 3548 KB
#include <bits/stdc++.h>
using namespace std;
#define name "aaaaaa"
using ll = long long;
using pii = pair<ll, ll>;

void file(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	if(fopen(name".inp", "r")) {
		freopen(name".inp", "r", stdin);
		freopen("checkcode.out", "w", stdout);
	}
}

const int maxn = 3e5 + 5;
pair<int, int> a[maxn];

void solve (){
	int n, q;
	cin >> n >> q;
	for(int i = 1; i <= n; i++){
		cin >> a[i].first >> a[i].second;
	}
	while(q--){
		int x, y, z;
		cin >> x >> y >> z;
		int ct = 0;
		for(int i = 1; i <= n; i++){
			if(a[i].first >= x && a[i].second >= y && a[i].first + a[i].second >= z) ct++;
		}
		cout << ct << endl;
	}
}

int main(){
	file();
	solve();
}

Compilation message

examination.cpp: In function 'void file()':
examination.cpp:10:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |   freopen(name".inp", "r", stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
examination.cpp:11:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   freopen("checkcode.out", "w", stdout);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 34 ms 644 KB Output is correct
8 Correct 35 ms 860 KB Output is correct
9 Correct 35 ms 640 KB Output is correct
10 Correct 34 ms 348 KB Output is correct
11 Correct 36 ms 348 KB Output is correct
12 Correct 34 ms 344 KB Output is correct
13 Correct 34 ms 604 KB Output is correct
14 Correct 34 ms 604 KB Output is correct
15 Correct 36 ms 620 KB Output is correct
16 Correct 15 ms 568 KB Output is correct
17 Correct 24 ms 580 KB Output is correct
18 Correct 16 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 3039 ms 3548 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3039 ms 3548 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 34 ms 644 KB Output is correct
8 Correct 35 ms 860 KB Output is correct
9 Correct 35 ms 640 KB Output is correct
10 Correct 34 ms 348 KB Output is correct
11 Correct 36 ms 348 KB Output is correct
12 Correct 34 ms 344 KB Output is correct
13 Correct 34 ms 604 KB Output is correct
14 Correct 34 ms 604 KB Output is correct
15 Correct 36 ms 620 KB Output is correct
16 Correct 15 ms 568 KB Output is correct
17 Correct 24 ms 580 KB Output is correct
18 Correct 16 ms 348 KB Output is correct
19 Execution timed out 3039 ms 3548 KB Time limit exceeded
20 Halted 0 ms 0 KB -