We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7c8f41 commit f566801Copy full SHA for f566801
Codechef/MAGICHF
@@ -0,0 +1,38 @@
1
+SEPTEMBER 2018 LONG CHALLENGE
2
+link to the problem
3
+
4
+https://www.codechef.com/SEPT18B/problems/MAGICHF/
5
6
+#include<stdio.h>
7
+int main()
8
+{
9
+int N,X,S,T,A,B;
10
+scanf("%d",&T);
11
+while(T--)
12
13
+scanf("%d%d%d",&N,&X,&S);
14
+while(S--)
15
16
+ scanf("%d%d",&A,&B);
17
+if(X==A)
18
19
+ X=B;
20
+}
21
+else if(X==B)
22
23
+ X=A;
24
25
26
27
28
+printf("%d\n",X);
29
30
+return 0;
31
32
33
34
35
36
37
38
0 commit comments