#include <bits/stdc++.h>
using namespace std;
int main () {
int t, n;
cin >> t >> n;
string str;
cin >> str;
vector<pair<pair<int,int>,int> > vec(n - 3);
set<int> st[n];
for (int i = 0; i < n - 3; i++) {
int x, y, c;
cin >> x >> y >> c;
x--, y--;
vec.push_back(make_pair(make_pair(x, y), c));
st[x].insert(y);
}
sort(vec.begin(), vec.end());
set<int> s;
for (int i = 0; i < n; i++) {
int myMax = -1;
for (int j: st[i]) {
myMax = max(myMax, j);
}
if (myMax != -1) {
auto it = s.upper_bound(i);
if (it != s.end() && *it <= myMax) {
cout << "neispravna triangulacija\n";
exit(0);
}
}
for (int j: st[i]) {
s.insert(j);
}
}
cout << "tocno\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
205 ms |
27080 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
210 ms |
27072 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |