Submission #995238

#TimeUsernameProblemLanguageResultExecution timeMemory
995238ASGA_RedSeaExamination (JOI19_examination)C++17
2 / 100
3073 ms2720 KiB
/**
 
                                    * بسم الله الرحمن الرحيم *
 
                ﴾ رَبِّ اشْرَحْ لِي صَدْرِي * وَيَسِّرْ لِي أَمْرِي * وَاحْلُلْ عُقْدَةً مِّن لِّسَانِي * يَفْقَهُوا قَوْلِي ﴿
 
*/
 
/// author : "ASGA"
 
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")
 
#include <bits/stdc++.h>
 
using namespace std;
 
signed main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
 
    int n,q,x,y,z,ans;
  	cin >> n >> q;
    vector <pair <int,int>> a(n);
    for(int i = 0;i < n;i++)cin >> a[i].first >> a[i].second;
    while(q--){
        cin >> x >> y >> z;ans = 0;
        for(int i = 0;i < n;i++)ans += (x <= a[i].first && y <= a[i].second && z <= a[i].first + a[i].second);
        cout << ans << '\n';
    }
 
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...