Submission #998238

#TimeUsernameProblemLanguageResultExecution timeMemory
998238cowwycowExamination (JOI19_examination)C++14
2 / 100
3039 ms3548 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...