# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
222466 | 2020-04-13T07:56:00 Z | SomeoneUnknown | Checker (COCI19_checker) | C++14 | 193 ms | 15936 KB |
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; typedef pair<int, ii> iii; //from, to, col ii mii(int a, int b){ return make_pair(a,b); } iii miii(int a, int b, int c){ return make_pair(a, mii(b,c)); } vector<vector<ii> > adjlist; int gcoloroflink(int f, int t){ if(f >= t){ exit(75); } int lo = -1; int hi = adjlist[f].size(); while(hi-lo > 1){ int mid = (lo+hi)/2; if(t == adjlist[f][mid].first){ return adjlist[f][mid].second; }else if(t < adjlist[f][mid].first){ hi = mid; }else{ lo = mid; } } exit(76); } int main(){ int n; scanf("%d", &n); scanf("%d", &n); char c; scanf("%c", &c); int col; vector<ii> x; adjlist.push_back(x); for(int i = 1; i <= n; i++){ vector<ii> x1; adjlist.push_back(x1); scanf("%c",&c); col = (int)(c-'0'); if(i == n){ adjlist[1].push_back(mii(n,col)); }else{ adjlist[i].push_back(mii(i+1,col)); } } iii edges[n-3]; for(int i = 0; i < n-3; i++){ int f, t; scanf("%d %d %d", &f, &t, &col); if(t < f){ int ph = f; f = t; t = ph; } edges[i] = miii(f,-t,col); adjlist[f].push_back(mii(t,col)); } sort(edges,edges+n-3); stack<int> dne; dne.push(-n-1); for(int i = 0; i < n-3; i++){ while(-dne.top() == edges[i].first){ dne.pop(); } int to = edges[i].second.first; //printf("%d %d\n", to, dne.top()); if(dne.top() > to){ printf("neispravna triangulacija"); return 0; } dne.push(to); } for(int i = 1; i <= n; i++){ sort(adjlist[i].begin(), adjlist[i].end()); } printf("tocno"); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 192 ms | 15936 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 193 ms | 15896 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |