Submission #1016836

#TimeUsernameProblemLanguageResultExecution timeMemory
1016836vjudge1Checker (COCI19_checker)C++17
23 / 110
124 ms15328 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n>>n; string s; cin>>s; int l[n]={}; vector<int> r[n]; for (int i=0;i<n-3;i++) { int x,y,c; cin>>x>>y>>c; x--,y--; if (x>y) swap(x,y); l[x]++; r[y].push_back(x); } for (int i=0;i<n;i++) sort(r[i].rbegin(),r[i].rend()); stack<int> st; for (int i=0;i<n;i++) { for (int i:r[i]) { if (st.top()!=i) { cout<<"neispravna triangulacija"<<endl; return 0; } st.pop(); } while (l[i]--) st.push(i); } 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...