| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 963457 | riariti | Dijamant (COI16_dijament) | C++17 | 1597 ms | 4724 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
namespace MX {
constexpr int N = 1E3 + 9;
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int N;
std::cin >> N;
std::map<std::string, int> cc;
std::vector anc(N, std::bitset<MX::N>(0));
for (int k = 0; k < N; k++) {
std::string K;
std::cin >> K;
bool bad = cc.count(K);
std::vector<int> P;
std::string s;
std::cin >> s;
while (true) {
std::cin >> s;
if (s == ";") {
break;
}
if (!cc.count(s)) {
bad = true;
continue;
}
auto v = cc[s];
P.push_back(v);
anc[k] |= anc[v];
anc[k][v] = true;
}
for (int i = 0; i < P.size() && !bad; i++) {
for (int j = i + 1; j < P.size() && !bad; j++) {
auto u = P[i];
auto v = P[j];
auto f = anc[u] & anc[v];
if (f.any()) {
bad |= !(anc[u][v] || anc[v][u]);
}
}
}
if (bad) {
std::cout << "greska\n";
continue;
}
std::cout << "ok\n";
cc[K] = k;
}
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... | ||||
