Submission #788686

#TimeUsernameProblemLanguageResultExecution timeMemory
788686prefixorsuuffiixxExamination (JOI19_examination)C++14
2 / 100
3081 ms2408 KiB
//ashoori is my love //ashoori is my love//ashoori is my love//ashoori is my love//ashoori is my love//ashoori is my love #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef int it; typedef pair<ll, ll> pii; typedef pair<ll, pii> piii; #pragma GCC optimize ("O3") #pragma GCC target("avx2") #pragma GCC optimize("Ofast,unroll-loops") #define sep "\n" #define pes " " #define int long long #define print(x,n) for(int i=1; i<=n ; i++)cout<<x[i]<<" " #define scan(x,n) for(int i=1 ; i<=n ; i++)cin>>x[i] #define all(x) x.begin(), x.end() #define pb push_back #define F first #define Se second #define sz size #define cin2(r,j) cin>>r>>j #define cin1(r) cin>>r #define cin3(r,j,k) cin>>r>>j>>k # define InTheNameOfGod ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); const int maxx=1e5+1000; const ll MOD=1000000007; const ll inf=1e18; int a[maxx],b[maxx]; void solve(){ int n , m ; cin>>n>>m; for(int i = 1 ; i <= n ; i++)cin>>a[i]>>b[i]; for(int i = 1 ; i <= m ; i++){ int ans = 0; int x , y , z; cin>>x>>y>>z; for(int j = 1 ; j <= n ; j++ ) if(a[j]>=x && b[j]>=y && a[j]+b[j] >= z)ans++; cout<<ans<<"\n"; } } /*===========================================================================================================================*/ signed main(){ InTheNameOfGod; //int tt = clock(); //cout << fixed << setprecision(6); int tc = 1; //cin>>tc; //for(int i = 1 ; i <= 3 ; i++)cout<<dp[i]<<" "; while(tc--){solve(); //cerr << "TIME = " << clock() - tt << endl; //tt = clock(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...