#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define int long long
#define pq priority_queue
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pp pop_back
#define F first
#define S second
using namespace std;
void solve () {
int n, m;
cin >> n >> m;
vector<int> a(n);
for (auto &i: a) cin >> i;
sort(rall(a));
a.pb(0);
int mn = a[0], c = 1;
for (int i = 1; i <= n; i++) {
mn += (a[i-1] - a[i]) * c;
mn++;
c++;
}
int q; cin >> q;
while (q--) {
int s, e, t;
cin >> s >> e >> t;
if (t >= mn) cout << "Yes\n";
else cout << "No\n";
}
}
signed main() {IOS solve(); return 0;}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |