-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbreakup app.cpp
More file actions
81 lines (70 loc) · 1.45 KB
/
Copy pathbreakup app.cpp
File metadata and controls
81 lines (70 loc) · 1.45 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int x=0,y=0;
int t;
cin>>t;
string s;
int date=0,breakup=0;
int c=0,c1=0,c3=0;
for(int i=0;i<t;i++)
{
getline(cin,s);
if(s[0]=='G')
{
for(int i=0;i<s.length();i++)
{
x=s[i]-'0';
y=s[i+1]-'0';
if(10*x+y==19)
{
c+=2;
}
else if(10*x+y==20)
{
c1+=2;
}
else if((x>=0&&x<=9) && (y>=0&&y<=9))
{
c3+=2;
}
}
}
if(s[0]=='B')
{
for(int i=0;i<s.length();i++)
{
x=s[i]-'0';
y=s[i+1]-'0';
if(10*x+y==19)
{
c++;
}
else if(10*x+y==20)
{
c1++;
}
else if((x>=0 && x<=9) && (y>=0&&y<=9))
{
c3++;
}
}
}
}
if(c==c1)
{
cout<<"No Date"<<endl;
}
else if(c>c3||c1>c3)
{
cout<<"Date"<<endl;
}
else
{
cout<<"No Date"<<endl;
}
}