pb_jiang

ABC457E

May 10th, 2026
168
0
Never
7
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.91 KB | None | 0 0
  1. // Problem: E - Crossing Table Cloth
  2. // Contest: AtCoder - Polaris.AI Programming Contest 2026(AtCoder Beginner Contest 457)
  3. // URL: https://atcoder.jp/contests/abc457/tasks/abc457_e
  4. // Memory Limit: 1024 MB
  5. // Time Limit: 2500 ms
  6. //
  7. // Powered by CP Editor (https://cpeditor.org)
  8.  
  9. #include <assert.h>
  10. #include <bits/stdc++.h>
  11. using namespace std;
  12. #ifndef __DEBUG__
  13. #define dbg(...) 42
  14. #endif
  15. template <class T> using mpq = priority_queue<T, vector<T>, greater<T>>;
  16.  
  17. namespace rngs = std::ranges;
  18. using ll = long long;
  19. using a2l = array<ll, 2>;
  20. using vl = vector<ll>;
  21.  
  22. void solve()
  23. {
  24.     ll n, m, q;
  25.     cin >> n >> m;
  26.     vector<a2l> rs(m);
  27.     for (auto &x : rs)
  28.         cin >> x[0] >> x[1];
  29.     rngs::sort(rs);
  30.  
  31.     cin >> q;
  32.     using a3l = array<ll, 3>;
  33.     vector<a3l> qs(q);
  34.     for (auto &x : qs)
  35.         cin >> x[0] >> x[1];
  36.     for (ll i = 0; i < q; ++i)
  37.         qs[i][2] = i;
  38.  
  39.     rngs::sort(qs);
  40.     vl ans(q);
  41.     vector<vl> lb(n + 1), rb(n + 1);
  42.     for (auto [x, y] : rs) {
  43.         dbg(x, y);
  44.         assert(x >= 1 && x <= n);
  45.         assert(y >= 1 && y <= n);
  46.         lb[y].push_back(x), rb[x].push_back(y);
  47.     }
  48.  
  49.     for (auto &x : lb)
  50.         rngs::sort(x);
  51.     for (auto &x : rb)
  52.         rngs::sort(x);
  53.  
  54.     for (auto [x, y, id] : qs) {
  55.         if (rb[x].empty())
  56.             continue;
  57.         auto it = upper_bound(rb[x].begin(), rb[x].end(), y) - rb[x].begin();
  58.         if (it == 0)
  59.             continue;
  60.         ll v = rb[x][it - 1];
  61.  
  62.         auto it2 = upper_bound(lb[y].begin(), lb[y].end(), v) - lb[y].begin();
  63.         if (it2 != 0 && lb[y][it2 - 1] >= x)
  64.             ans[id] = 1;
  65.     }
  66.  
  67.     for (auto x : ans)
  68.         cout << (x ? "Yes" : "No") << endl;
  69. }
  70.  
  71. int main(int argc, char **argv)
  72. {
  73.     std::ios::sync_with_stdio(false);
  74.     std::cin.tie(nullptr);
  75.  
  76.     ll t = 1;
  77.     // cin >> t;
  78.     while (t--)
  79.         solve();
  80.  
  81.     return 0;
  82. };
  83.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Dolzorer
    34 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Nokhimmi
    12 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=tahcuhbzxu
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment