# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
847021 | 2023-09-09T01:59:46 Z | 12345678 | 슈퍼트리 잇기 (IOI20_supertrees) | C++17 | 1 ms | 348 KB |
#include "supertrees.h" #include <bits/stdc++.h> using namespace std; const int nx=1e3+5; int gc; bool vs[nx]; vector<vector<int>> g(nx); int construct(std::vector<std::vector<int>> p) { int n = p.size(); vector<vector<int>> answer(n, vector<int> (n, 0)); for (int i=0; i<n; i++) { if (!vs[i]) { queue<int> q; q.push(i); vs[i]=1; while (!q.empty()) { int x=q.front(); q.pop(); g[gc].push_back(x); for (int j=0; j<n; j++) if (p[x][j]==2&&!vs[j]) q.push(j), vs[j]=1; } for (auto x:g[gc]) for (auto y:g[gc]) if (p[x][y]==0) return 0; int s=g[gc].size(); if (s==1) continue; for (int j=0; j<g[gc].size(); j++) answer[g[gc][j]][g[gc][(j+1)%s]]=answer[g[gc][(j+1)%s]][g[gc][j]]=1; gc++; } } build(answer); return 1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 0 ms | 348 KB | Too few ways to get from 0 to 2, should be 1 found 0 |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 0 ms | 348 KB | Too few ways to get from 0 to 2, should be 1 found 0 |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Answer gives possible 0 while actual possible 1 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Answer gives possible 0 while actual possible 1 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 0 ms | 348 KB | Too few ways to get from 0 to 2, should be 1 found 0 |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 0 ms | 348 KB | Too few ways to get from 0 to 2, should be 1 found 0 |
4 | Halted | 0 ms | 0 KB | - |