This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define fs first
#define sc second
set<int> st;
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n;
cin>>n>>n;
string col;
vector<pair<pii,int>> v(n-3);
cin>>col;
for(int i = 0;i<n-3;i++){
v.push_back({{0,0},0});
cin>>v[i].fs.fs>>v[i].fs.sc>>v[i].sc;
if(v[i].fs.fs>v[i].fs.sc)swap(v[i].fs.fs,v[i].fs.sc);
}
sort(v.begin(),v.end());
st.insert(v[0].fs.fs);
st.insert(v[0].fs.sc);
for(auto &i:v){
auto lit = st.upper_bound(i.fs.fs);
auto rit = st.lower_bound(i.fs.sc);
if(lit != rit){
cout<<"neispravna triangulacija\n";
return 0;
}
st.insert(i.fs.fs);
st.insert(i.fs.sc);
}
cout<<"tocno\n";
return 0;
}
# | 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... |