Submission #1057534

#TimeUsernameProblemLanguageResultExecution timeMemory
1057534beaconmcGift Exchange (JOI24_ho_t4)C++14
10 / 100
2596 ms4820 KiB
#include <bits/stdc++.h> typedef long long ll; #define FOR(i,x,y) for(ll i=x; i<y; i++) #define FORNEG(i,x,y) for(ll i=x; i>y; i--) using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); ll n; cin >> n; vector<ll> vals(n), req(n); FOR(i,0,n) cin >> vals[i]; FOR(i,0,n) cin >> req[i]; ll q; cin >> q; FOR(i,0,q){ ll a,b; cin >> a >> b; a--;b--; vector<ll> idk, idk2; bool flag = false; FOR(j,a,b+1){ idk.push_back(vals[j]); idk2.push_back(req[j]); } sort(idk.begin(), idk.end()); sort(idk2.begin(), idk2.end()); ll l = idk.size()-1; FORNEG(j, idk.size()-1, -1){ if (j != idk.size()-1 && l == j){ flag = 1; break; } while (l>=0 && idk[l] >= idk2[j]) l--; } if (flag) cout << "No" << "\n"; else cout << "Yes" << "\n"; } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:37:10: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |    if (j != idk.size()-1 && l == j){
      |        ~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...