-
Notifications
You must be signed in to change notification settings - Fork 2
/
1419.cpp
63 lines (56 loc) · 1.49 KB
/
1419.cpp
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
#include <bits/stdc++.h>
using namespace std;
int main()
{
int rounds;
int i;
while(scanf("%d", &rounds), rounds != 0)
{
int mark[rounds+1], leti[rounds+1];
mark[rounds] = 0, leti[rounds] = 0;
for(i = 0; i < rounds; i++)
scanf("%d", &mark[i]);
for(i =0; i < rounds; i++)
scanf("%d", &leti[i]);
int cntm =0, cntl =0, auxm, auxl,
cauxm = 1, cauxl = 1;
bool bonus = true;
for(i = 0; i < rounds; i++)
{
cntm += mark[i];
cntl += leti[i];
auxm = mark[i];
auxl = leti[i];
if(bonus)
{
if(auxm == mark[i+1])
cauxm++;
if(auxl == leti[i+1])
cauxl++;
if(auxm != mark[i+1])
cauxm = 1;
if(auxl != leti[i+1])
cauxl = 1;
if(cauxm == 3 && cauxl == 3)
bonus = false;
if(cauxm == 3 && cauxl < 3)
{
cntm +=30;
bonus = false;
}
if(cauxl == 3 && cauxm < 3)
{
cntl += 30;
bonus = false;
}
}
}
if(cntm > cntl)
printf("M\n");
if(cntl > cntm)
printf("L\n");
if(cntm == cntl)
printf("T\n");
}
return 0;
}