# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
974038 | 2024-05-02T15:59:57 Z | AliHasanli | 슈퍼트리 잇기 (IOI20_supertrees) | C++17 | 251 ms | 24148 KB |
#include "supertrees.h" #include<bits/stdc++.h> #include <vector> using namespace std; bool used[1001]; int construct(vector<vector<int> > p) { vector<int>v; int n=p.size(); int b=1; vector<vector<int> >answer; answer.resize(n); for (int i=0;i<n;i++) { answer[i].resize(n); } for(int i=0;i<n;i++){ if(used[i]==false) { v.clear(); for(int j=0;j<n;j++) if(p[i][j]) { if(p[i]==p[j]){ v.push_back(j); } else{ b=0; } } for(int j=0;j<v.size()-1;j++) answer[v[j]][v[j+1]]=answer[v[j+1]][v[j]]=1; } } if(b==0){ return 0; } build(answer); return 1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 7 ms | 1112 KB | Output is correct |
7 | Correct | 251 ms | 21996 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 7 ms | 1112 KB | Output is correct |
7 | Correct | 251 ms | 21996 KB | Output is correct |
8 | Correct | 1 ms | 344 KB | Output is correct |
9 | Correct | 1 ms | 856 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Correct | 7 ms | 1372 KB | Output is correct |
13 | Correct | 173 ms | 24064 KB | Output is correct |
14 | Correct | 0 ms | 344 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Correct | 3 ms | 860 KB | Output is correct |
17 | Correct | 75 ms | 14472 KB | Output is correct |
18 | Correct | 0 ms | 344 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 41 ms | 6260 KB | Output is correct |
21 | Correct | 162 ms | 23888 KB | Output is correct |
22 | Correct | 150 ms | 24144 KB | Output is correct |
23 | Correct | 198 ms | 24144 KB | Output is correct |
24 | Correct | 152 ms | 24052 KB | Output is correct |
25 | Correct | 72 ms | 14076 KB | Output is correct |
26 | Correct | 66 ms | 14220 KB | Output is correct |
27 | Correct | 206 ms | 24148 KB | Output is correct |
28 | Correct | 150 ms | 23940 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Incorrect | 0 ms | 348 KB | Answer gives possible 0 while actual possible 1 |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Answer gives possible 0 while actual possible 1 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 7 ms | 1112 KB | Output is correct |
7 | Correct | 251 ms | 21996 KB | Output is correct |
8 | Correct | 1 ms | 344 KB | Output is correct |
9 | Correct | 1 ms | 856 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Correct | 7 ms | 1372 KB | Output is correct |
13 | Correct | 173 ms | 24064 KB | Output is correct |
14 | Correct | 0 ms | 344 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Correct | 3 ms | 860 KB | Output is correct |
17 | Correct | 75 ms | 14472 KB | Output is correct |
18 | Correct | 0 ms | 344 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 41 ms | 6260 KB | Output is correct |
21 | Correct | 162 ms | 23888 KB | Output is correct |
22 | Correct | 150 ms | 24144 KB | Output is correct |
23 | Correct | 198 ms | 24144 KB | Output is correct |
24 | Correct | 152 ms | 24052 KB | Output is correct |
25 | Correct | 72 ms | 14076 KB | Output is correct |
26 | Correct | 66 ms | 14220 KB | Output is correct |
27 | Correct | 206 ms | 24148 KB | Output is correct |
28 | Correct | 150 ms | 23940 KB | Output is correct |
29 | Correct | 0 ms | 348 KB | Output is correct |
30 | Correct | 0 ms | 348 KB | Output is correct |
31 | Correct | 0 ms | 344 KB | Output is correct |
32 | Correct | 0 ms | 348 KB | Output is correct |
33 | Incorrect | 0 ms | 348 KB | Answer gives possible 0 while actual possible 1 |
34 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 7 ms | 1112 KB | Output is correct |
7 | Correct | 251 ms | 21996 KB | Output is correct |
8 | Correct | 1 ms | 344 KB | Output is correct |
9 | Correct | 1 ms | 856 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Correct | 7 ms | 1372 KB | Output is correct |
13 | Correct | 173 ms | 24064 KB | Output is correct |
14 | Correct | 0 ms | 344 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Correct | 3 ms | 860 KB | Output is correct |
17 | Correct | 75 ms | 14472 KB | Output is correct |
18 | Correct | 0 ms | 344 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 41 ms | 6260 KB | Output is correct |
21 | Correct | 162 ms | 23888 KB | Output is correct |
22 | Correct | 150 ms | 24144 KB | Output is correct |
23 | Correct | 198 ms | 24144 KB | Output is correct |
24 | Correct | 152 ms | 24052 KB | Output is correct |
25 | Correct | 72 ms | 14076 KB | Output is correct |
26 | Correct | 66 ms | 14220 KB | Output is correct |
27 | Correct | 206 ms | 24148 KB | Output is correct |
28 | Correct | 150 ms | 23940 KB | Output is correct |
29 | Correct | 0 ms | 348 KB | Output is correct |
30 | Correct | 0 ms | 348 KB | Output is correct |
31 | Correct | 0 ms | 344 KB | Output is correct |
32 | Correct | 0 ms | 348 KB | Output is correct |
33 | Incorrect | 0 ms | 348 KB | Answer gives possible 0 while actual possible 1 |
34 | Halted | 0 ms | 0 KB | - |