Submission #55339


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <bits/stdc++.h>
using namespace std;
signed main(){
int n,m,r,a,b,c[100000],d=1;
cin>>n>>m>>r;
c[m]=1;
for(int i=0;i<r;i++){
cin>>a>>b;
if(c[a]==1 || c[b]==1){
if(c[a]==1 && c[b]==1)
continue;
else if(n==d)
break;
else{
c[a]=1;
c[b]=1;
d++;
}
}
}
cout<<d<<endl;
return(0);
}

ステータス

項目 データ
問題 1188 - マジック
ユーザー名 r1910
投稿日時 2019-09-27 19:17:21
言語 C++
状態 Accepted
得点 1
ソースコード長 375 Byte
最大実行時間 25 ms
最大メモリ使用量 536 KB

セット

セット 得点 Cases
1 ALL 1 / 1 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.text AC 20 ms 476 KB
1
in02.text AC 25 ms 448 KB
1
in03.text AC 19 ms 412 KB
1
in04.text AC 24 ms 504 KB
1
in05.text AC 19 ms 464 KB
1
in06.text AC 20 ms 424 KB
1
in07.text AC 23 ms 516 KB
1
sample1.text AC 20 ms 480 KB
1
sample2.text AC 24 ms 444 KB
1
sample3.text AC 19 ms 536 KB
1