# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
934882 | 2024-02-28T06:15:09 Z | irmuun | Political Development (BOI17_politicaldevelopment) | C++17 | 282 ms | 524288 KB |
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n,k; cin>>n>>k; ll d[n]; vector<ll>adj[n]; bool ok=false; bool dis[n][n]; memset(dis,0,sizeof dis); for(ll i=0;i<n;i++){ cin>>d[i]; if(d[i]>0) ok=true; adj[i].resize(d[i]); for(ll j=0;j<d[i];j++){ cin>>adj[i][j]; dis[i][adj[i][j]]=true; } } bool k3=false; for(ll i=0;i<n;i++){ for(ll j=0;j<adj[i].size();j++){ for(ll r=j+1;r<adj[i].size();r++){ if(dis[adj[i][j]][adj[i][r]]==true){ k3=true; } } } } if(k3){ cout<<3; } else if(ok){ cout<<2; } else{ cout<<1; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 17 ms | 25120 KB | Output is correct |
4 | Correct | 28 ms | 25180 KB | Output is correct |
5 | Correct | 27 ms | 25180 KB | Output is correct |
6 | Correct | 22 ms | 25136 KB | Output is correct |
7 | Correct | 18 ms | 25176 KB | Output is correct |
8 | Correct | 15 ms | 24924 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 15 ms | 24924 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 17 ms | 25120 KB | Output is correct |
4 | Correct | 28 ms | 25180 KB | Output is correct |
5 | Correct | 27 ms | 25180 KB | Output is correct |
6 | Correct | 22 ms | 25136 KB | Output is correct |
7 | Correct | 18 ms | 25176 KB | Output is correct |
8 | Correct | 15 ms | 24924 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 15 ms | 24924 KB | Output is correct |
11 | Correct | 28 ms | 25180 KB | Output is correct |
12 | Correct | 27 ms | 25180 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 28 ms | 25088 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Correct | 18 ms | 25296 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 18 ms | 25288 KB | Output is correct |
19 | Correct | 15 ms | 24920 KB | Output is correct |
20 | Correct | 16 ms | 25176 KB | Output is correct |
21 | Correct | 16 ms | 25180 KB | Output is correct |
22 | Correct | 15 ms | 25032 KB | Output is correct |
23 | Correct | 17 ms | 25180 KB | Output is correct |
24 | Correct | 15 ms | 24924 KB | Output is correct |
25 | Correct | 17 ms | 25084 KB | Output is correct |
26 | Correct | 17 ms | 25180 KB | Output is correct |
27 | Correct | 18 ms | 25044 KB | Output is correct |
28 | Correct | 17 ms | 25180 KB | Output is correct |
29 | Correct | 16 ms | 25180 KB | Output is correct |
30 | Correct | 21 ms | 25180 KB | Output is correct |
31 | Correct | 17 ms | 25176 KB | Output is correct |
32 | Correct | 22 ms | 25172 KB | Output is correct |
33 | Correct | 17 ms | 25176 KB | Output is correct |
34 | Correct | 17 ms | 25176 KB | Output is correct |
35 | Correct | 4 ms | 6748 KB | Output is correct |
36 | Correct | 4 ms | 6744 KB | Output is correct |
37 | Correct | 4 ms | 6620 KB | Output is correct |
38 | Correct | 1 ms | 1884 KB | Output is correct |
39 | Correct | 2 ms | 1884 KB | Output is correct |
40 | Correct | 18 ms | 25272 KB | Output is correct |
41 | Correct | 1 ms | 1880 KB | Output is correct |
42 | Correct | 19 ms | 25180 KB | Output is correct |
43 | Correct | 19 ms | 25176 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 18 ms | 24920 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Incorrect | 0 ms | 348 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 17 ms | 25120 KB | Output is correct |
4 | Correct | 28 ms | 25180 KB | Output is correct |
5 | Correct | 27 ms | 25180 KB | Output is correct |
6 | Correct | 22 ms | 25136 KB | Output is correct |
7 | Correct | 18 ms | 25176 KB | Output is correct |
8 | Correct | 15 ms | 24924 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 15 ms | 24924 KB | Output is correct |
11 | Correct | 28 ms | 25180 KB | Output is correct |
12 | Correct | 27 ms | 25180 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 28 ms | 25088 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Correct | 18 ms | 25296 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 18 ms | 25288 KB | Output is correct |
19 | Correct | 15 ms | 24920 KB | Output is correct |
20 | Correct | 16 ms | 25176 KB | Output is correct |
21 | Correct | 16 ms | 25180 KB | Output is correct |
22 | Correct | 15 ms | 25032 KB | Output is correct |
23 | Correct | 17 ms | 25180 KB | Output is correct |
24 | Correct | 15 ms | 24924 KB | Output is correct |
25 | Correct | 17 ms | 25084 KB | Output is correct |
26 | Correct | 17 ms | 25180 KB | Output is correct |
27 | Correct | 18 ms | 25044 KB | Output is correct |
28 | Correct | 17 ms | 25180 KB | Output is correct |
29 | Correct | 16 ms | 25180 KB | Output is correct |
30 | Correct | 21 ms | 25180 KB | Output is correct |
31 | Correct | 17 ms | 25176 KB | Output is correct |
32 | Correct | 22 ms | 25172 KB | Output is correct |
33 | Correct | 17 ms | 25176 KB | Output is correct |
34 | Correct | 17 ms | 25176 KB | Output is correct |
35 | Correct | 4 ms | 6748 KB | Output is correct |
36 | Correct | 4 ms | 6744 KB | Output is correct |
37 | Correct | 4 ms | 6620 KB | Output is correct |
38 | Correct | 1 ms | 1884 KB | Output is correct |
39 | Correct | 2 ms | 1884 KB | Output is correct |
40 | Correct | 18 ms | 25272 KB | Output is correct |
41 | Correct | 1 ms | 1880 KB | Output is correct |
42 | Correct | 19 ms | 25180 KB | Output is correct |
43 | Correct | 19 ms | 25176 KB | Output is correct |
44 | Incorrect | 20 ms | 25436 KB | Output isn't correct |
45 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 17 ms | 25120 KB | Output is correct |
4 | Correct | 28 ms | 25180 KB | Output is correct |
5 | Correct | 27 ms | 25180 KB | Output is correct |
6 | Correct | 22 ms | 25136 KB | Output is correct |
7 | Correct | 18 ms | 25176 KB | Output is correct |
8 | Correct | 15 ms | 24924 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 15 ms | 24924 KB | Output is correct |
11 | Correct | 28 ms | 25180 KB | Output is correct |
12 | Correct | 27 ms | 25180 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 28 ms | 25088 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Correct | 18 ms | 25296 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 18 ms | 25288 KB | Output is correct |
19 | Correct | 15 ms | 24920 KB | Output is correct |
20 | Correct | 16 ms | 25176 KB | Output is correct |
21 | Correct | 16 ms | 25180 KB | Output is correct |
22 | Correct | 15 ms | 25032 KB | Output is correct |
23 | Correct | 17 ms | 25180 KB | Output is correct |
24 | Correct | 15 ms | 24924 KB | Output is correct |
25 | Correct | 17 ms | 25084 KB | Output is correct |
26 | Correct | 17 ms | 25180 KB | Output is correct |
27 | Correct | 18 ms | 25044 KB | Output is correct |
28 | Correct | 17 ms | 25180 KB | Output is correct |
29 | Correct | 16 ms | 25180 KB | Output is correct |
30 | Correct | 21 ms | 25180 KB | Output is correct |
31 | Correct | 17 ms | 25176 KB | Output is correct |
32 | Correct | 22 ms | 25172 KB | Output is correct |
33 | Correct | 17 ms | 25176 KB | Output is correct |
34 | Correct | 17 ms | 25176 KB | Output is correct |
35 | Correct | 4 ms | 6748 KB | Output is correct |
36 | Correct | 4 ms | 6744 KB | Output is correct |
37 | Correct | 4 ms | 6620 KB | Output is correct |
38 | Correct | 1 ms | 1884 KB | Output is correct |
39 | Correct | 2 ms | 1884 KB | Output is correct |
40 | Correct | 18 ms | 25272 KB | Output is correct |
41 | Correct | 1 ms | 1880 KB | Output is correct |
42 | Correct | 19 ms | 25180 KB | Output is correct |
43 | Correct | 19 ms | 25176 KB | Output is correct |
44 | Correct | 0 ms | 348 KB | Output is correct |
45 | Runtime error | 282 ms | 524288 KB | Execution killed with signal 9 |
46 | Halted | 0 ms | 0 KB | - |