| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 292314 | kingfran1907 | Checker (COCI19_checker) | C++14 | 238 ms | 10848 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long llint;
const int maxn = 2e5+10;
const int base = 31337;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int logo = 20;
const int off = 1 << logo;
const int treesiz = off << 1;
int t;
int n;
int c[maxn];
vector< pair< pair<int, int>, int > > v;
bool bio[maxn];
int nx[maxn];
bool cmp(pair< pair<int, int>, int> a, pair< pair<int, int>, int> b) {
return ((a.X.Y - a.X.X + n) % n) < ((b.X.Y - b.X.X + n) % n);
}
int main() {
scanf("%d%d", &t, &n);
memset(bio, false, sizeof bio);
for (int i = 0; i < n; i++) {
char x;
scanf(" %c", &x);
c[i] = x - '1';
nx[i] = (i + 1) % n;
}
for (int i = 3; i < n; i++) {
int a, b, c;
scanf("%d%d%d", &a, &b, &c); a--, b--, c--;
v.push_back(make_pair(make_pair(a, b), c));
v.push_back(make_pair(make_pair(b, a), c));
}
sort(v.begin(), v.end(), cmp);
bool flag1 = true;
bool flag2 = true;
for (int i = 0; i < n - 3; i++) {
int x = v[i].X.X;
int y = v[i].X.Y;
int cl = v[i].Y;
//printf("debug: %d %d -> %d %d %d\n", x + 1, y + 1, c[x], c[nx[x]], cl);
if (bio[x] || bio[y]) {
flag1 = false;
break;
}
if (nx[nx[x]] != y) {
flag1 = false;
break;
}
bio[nx[x]] = true;
if (!(c[x] + c[nx[x]] + cl == 3 && min({c[x], c[nx[x]], cl}) == 0)) flag2 = false;
c[x] = cl;
nx[x] = y;
}
if (!flag1) printf("neispravna triangulacija\n");
else if (!flag2) printf("neispravno bojenje\n");
else printf("tocno\n");
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
