제출 #1094539

#제출 시각아이디문제언어결과실행 시간메모리
1094539I_am_Polish_GirlGift Exchange (JOI24_ho_t4)C++14
50 / 100
2599 ms6928 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 mn = inf; int c = 0; for (int i = vp.size() - 1; i >= 0; i--) { if (i >= 1) { if (vp[i - 1].first >= vp[i].second) { mn = min(mn, vp[i].second); continue; } } if (i < vp.size() - 1) { if (vp[i].first >= mn) { mn = min(mn, vp[i].second); continue; } } c = 1; mn = min(mn, vp[i].second); } if (c > 0) cout << "No\n"; else cout << "Yes\n"; } }

컴파일 시 표준 에러 (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:89: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]
   89 |             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...