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 3b4783a commit 22b0803Copy full SHA for 22b0803
Codeshef/FBMT.cpp
@@ -0,0 +1,53 @@
1
+#include <bits/stdc++.h>
2
+using namespace std;
3
+
4
+int main() {
5
+ int T;
6
+ cin>>T;
7
+ while(T--){
8
+ int n;
9
+ cin>>n;
10
+ int a=0,b=0,temp=0;
11
+ char team1[22]={},team2[22]={},tteam[22]={};
12
+ for(int i=0;i<n;i++){
13
+ cin>>tteam;
14
+ if(i==0){
15
+ for(int j=0;j<strlen(tteam);j++){
16
+ team1[j]=tteam[j];
17
+ }
18
+ a++;
19
20
+ else{
21
22
+ if(team1[j]==tteam[j]){
23
+ temp=0;
24
25
26
+ temp=1;
27
+ break;
28
29
30
+ if(temp==0){
31
32
33
34
35
+ team2[j]=tteam[j];
36
37
+ b++;
38
39
40
41
42
+ if(a==b){
43
+ cout<<"Draw"<<endl;
44
45
+ if(a>b){
46
+ cout<<team1<<endl;
47
48
+ if(b>a){
49
+ cout<<team2<<endl;
50
51
52
+ return 0;
53
+}
0 commit comments