結果
問題 |
No.2885 Range Triangle Collision Decision Queries
|
ユーザー |
|
提出日時 | 2024-09-08 19:22:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 759 bytes |
コンパイル時間 | 4,385 ms |
コンパイル使用メモリ | 256,124 KB |
最終ジャッジ日時 | 2025-02-24 05:47:25 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 31 WA * 22 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using ll = long long; constexpr ll INF = 1ll << 60; using S = tuple<ll,ll,ll>; S op(S lhs, S rhs){ auto [a1, b1, c1] = lhs; auto [a2, b2, c2] = rhs; return make_tuple(max(a1, a1), min(b1, b2), min(c1, c2)); } constexpr S e(){ return make_tuple(-INF, INF, INF); } int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, Q; cin >> n; vector<S> a(n); for(int i = 0; i < n; i++){ ll x, y, d; cin >> x >> y >> d; a[i] = make_tuple(y - d, x + y, -(x - y)); } atcoder::segtree<S, op, e> seg(a); cin >> Q; while(Q--){ int s, l, r; cin >> s >> l >> r; s--, l--; auto [y, u, v] = op(a[s], seg.prod(l, r)); cout << (u + v > 2 * y ? "Yes" : "No") << '\n'; } }