Submission #1094536

#TimeUsernameProblemLanguageResultExecution timeMemory
1094536I_am_Polish_GirlGift Exchange (JOI24_ho_t4)C++14
0 / 100
2578 ms6044 KiB
#pragma GCC optimize("Ofast") #pragma GCC optimize("O3") #pragma GCC optimization ("unroll-loops") #include <vector> #include <algorithm> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <stack> #include <queue> #include <cmath> #include <random> #include <chrono> #include <iomanip> #include <iostream> #include <bitset> #include <cmath> #define int long long using namespace std; int log_ = 3; int inf = 2000000007000000007; int mod = 1000000007; int p = 501; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; vector <int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; vector <int> b(n); for (int i = 0; i < n; i++) cin >> b[i]; int q; cin >> q; while (q--) { int l, r; cin >> l >> r; l--; r--; vector <pair <int, int>> vp; for (int i = l; i <= r; i++) { vp.push_back({ a[i] , b[i]}); } sort(vp.begin(), vp.end()); int c = 0; for (int i = 0; i < vp.size(); i++) { if (i >= 1) { if (vp[i - 1].first >= vp[i].second) continue; } if (i < vp.size() - 1) { if (vp[i].first >= vp[i+1].second) continue; } c = 1; } if (c > 0) cout << "No\n"; else cout << "Yes\n"; } }

Compilation message (stderr)

Main.cpp:3: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    3 | #pragma GCC optimization ("unroll-loops")
      | 
Main.cpp: In function 'int main()':
Main.cpp:73:27: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   73 |         for (int i = 0; i < vp.size(); i++)
      |                         ~~^~~~~~~~~~~
Main.cpp:81:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   81 |             if (i < vp.size() - 1)
      |                 ~~^~~~~~~~~~~~~~~
#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...