Submission #1013089

#TimeUsernameProblemLanguageResultExecution timeMemory
1013089vjudge1Checker (COCI19_checker)C++17
0 / 110
137 ms5508 KiB
#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+1]=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); } if(check()==0) cout<<"neispravna triangulacija"<<endl; else cout<<"tocno"<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...