# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
632598 | 2022-08-20T11:50:30 Z | Mahdi | Jail (JOI22_jail) | C++17 | 0 ms | 212 KB |
#include<bits/stdc++.h> #pragma GCC optimize("Ofast") using namespace std; #define all(v) v.begin(), v.end() #define F first #define S second typedef pair<int, int> pii; typedef long long ll; int n, m; void sol(){ cin>>n; for(int i=1;i<n;++i){ int u, v; cin>>u>>v; if(u!=i || v!=u+1){ cout<<1/0; } } cin>>m; if(m!=2) cout<<1/0; int a, b, u, v; cin>>a>>b>>u>>v; if(a<b){ if(u<v){ ll x=1LL*(u-a)*(v-b); if(x>0) cout<<"YES\n"; else cout<<"NO\n"; } else{ if(v>b || u<a) cout<<"YES\n"; else cout<<"NO\n"; } } else{ if(u>v){ ll x=1LL*(u-a)*(v-b); if(x>0) cout<<"YES\n"; else cout<<"NO\n"; } else{ if(u>a || v<b) cout<<"YES\n"; else cout<<"NO\n"; } } } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int T; cin>>T; while(T--) sol(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |