# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
902895 | Tuanlinh123 | Jail (JOI22_jail) | C++17 | 5 ms | 468 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll t; cin >> t;
while (t--)
{
ll n; cin >> n;
for (ll i=1; i<n; i++)
{
ll u, v;
cin >> u >> v;
}
ll m; cin >> m;
vector <pll> range;
for (ll i=1; i<=m; i++)
{
ll l, r; cin >> l >> r;
if (l>r) swap(l, r);
range.pb({l, -r});
}
sort(range.begin(), range.end());
ll Max=0, ok=1;
for (pll i:range)
{
ll l=i.fi, r=-i.se;
if (Max>=r) {ok=0; break;}
Max=r;
}
if (ok) cout << "Yes\n";
else cout << "No\n";
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |