#include<bits/stdc++.h>
using namespace std;
int const N = 2e5 + 5;
vector<int> have[N];
bool instk[N];
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n, t;
cin >> t;
cin >> n;
string s;
cin >> s;
int u, v, c;
for(int i = 0; i < n - 3; i++){
cin >> u >> v >> c;
if(u > v)
swap(u, v);
have[u].push_back(v);
}
vector<int> stk;
for(int i = 1; i <= n; i++){
if(instk[i]){
if(stk.back() != i){
cout << "neispravna triangulacija\n";
return 0;
}else{
stk.pop_back();
instk[i] = 0;
}
}
sort(have[i].begin(), have[i].end());
for(int j = (int)have[i].size() - 1; j >= 0; j--){
stk.push_back(have[i][j]);
instk[have[i][j]] = 1;
}
}
cout << "tocno\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
4948 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
4948 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
67 ms |
8848 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
73 ms |
8840 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
4948 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |