-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2484.cpp
97 lines (87 loc) · 1.74 KB
/
2484.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// 2482. 주사위 네개
// 2020.11.26
// 구현
#include <iostream>
using namespace std;
int n;
int k;
int ans;
int dice[7];
int currentMoney = 0;
void Init()
{
for (int i = 0; i < 7; i++)
{
dice[i] = 0;
}
currentMoney = 0;
}
int main()
{
cin >> n;
while (n--)
{
Init();
for (int i = 0; i < 4; i++)
{
cin >> k;
dice[k]++;
}
for (int i = 1; i <= 6; i++)
{
if (dice[i] == 4)
{
currentMoney = 50000 + i * 5000;
break;
}
}
if (currentMoney == 0)
{
for (int i = 1; i <= 6; i++)
{
if (dice[i] == 3)
{
currentMoney = 10000 + i * 1000;
break;
}
}
}
if (currentMoney == 0)
{
int cnt = 0;
for (int i = 1; i <= 6; i++)
{
if (dice[i] == 2)
{
cnt++;
currentMoney += i;
}
}
if (cnt == 2)
{
currentMoney = 2000 + currentMoney * 500;
}
else if (cnt == 1)
{
currentMoney = 1000 + currentMoney * 100;
}
}
if (currentMoney == 0)
{
for (int i = 6; i >= 1; i--)
{
if (dice[i])
{
currentMoney = i * 100;
break;
}
}
}
if (ans < currentMoney)
{
ans = currentMoney;
}
}
cout << ans << endl;
return 0;
}