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 ll long long
int const N=2e5+5;
int const mod=1e9+7;
int bk[N],fr[N];
int n;
bool check(){
for(int i=1;i<n;i++){
// if(fr[i+1]==2 || bk[i]==n)
// continue;
if(fr[i+1]+1>bk[i])
return 0;
}
// if(fr[1]==2 || bk[n]==n)
// return 1;
if(fr[1]+1>bk[n])
return 0;
return 1;
}
int main(){
int t;
cin>>t;
cin>>n;
string col;
cin>>col;
for(int i=1;i<=n;i++){
fr[i]=2;
bk[i]=n;
}
for (int i = 0; i < n-3; ++i)
{
int a,b,c;
cin>>a>>b>>c;
if(a>b)
swap(a,b);
int ba=(b-a)+1;
fr[a]=max(fr[a],ba);
bk[a]=min(bk[a],ba);
int ab=(n+1)-(b-a);
fr[b]=max(fr[b],ab);
bk[b]=min(bk[b],ab);
}
// for (int i = 1; i <=n; ++i)
// cout<<fr[i]<<' '<<bk[i]<<endl;
if(check()==0)
cout<<"neispravna triangulacija"<<endl;
else
cout<<"tocno"<<endl;
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... |