Submission #55332
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include<bits/stdc++.h> #define INF 2147483647 #define inf 1000000007 #define SYOU(x) setprecision(x) #define abs(x,y) (max(x,y)-min(x,y)) #define mp make_pair #define fi first #define se second using namespace std; bool i[111100]; vector< int > ii; signed main(){ cin.tie(0); ios::sync_with_stdio( false ); long long a,b,c,d=1,e=1,f=0,g=1,h=1,j; cin >>a>>b>>c; i[b]= true ; for ( int n=0;n<c;n++){ cin >>d>>e; if (i[d]||i[e]) i[d]= true ,i[e]= true ; } for ( int n=1;n<=a;n++){ if (i[n]) f++; } cout <<f<< '\n' ; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 1188 - マジック |
ユーザー名 | r1910 |
投稿日時 | 2019-09-27 18:44:21 |
言語 | C++ |
状態 | Accepted |
得点 | 1 |
ソースコード長 | 571 Byte |
最大実行時間 | 27 ms |
最大メモリ使用量 | 688 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 1 / 1 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in01.text | AC | 24 ms | 476 KB |
1
|
in02.text | AC | 22 ms | 560 KB |
1
|
in03.text | AC | 16 ms | 516 KB |
1
|
in04.text | AC | 19 ms | 604 KB |
1
|
in05.text | AC | 20 ms | 688 KB |
1
|
in06.text | AC | 19 ms | 520 KB |
1
|
in07.text | AC | 26 ms | 608 KB |
1
|
sample1.text | AC | 27 ms | 688 KB |
1
|
sample2.text | AC | 22 ms | 512 KB |
1
|
sample3.text | AC | 24 ms | 472 KB |
1
|