-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11387.cpp
More file actions
42 lines (34 loc) · 1.06 KB
/
Copy path11387.cpp
File metadata and controls
42 lines (34 loc) · 1.06 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
/* reference: https://github.com/blisstoner/BOJ/blob/master/11387.py */
#include <iostream>
#include <algorithm>
using namespace std;
long long x[4][5];
int main() {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 5; j++)
scanf("%lld", &x[i][j]);
}
long long a = x[0][0] * (100 + x[0][1])*(100 * (100 - min(x[0][2], 100LL)) + min(x[0][2], 100LL) * x[0][3])*(100 + x[0][4]);
long long b = x[1][0] * (100 + x[1][1])*(100 * (100 - min(x[1][2], 100LL)) + min(x[1][2], 100LL) * x[1][3])*(100 + x[1][4]);
for (int j = 0; j < 5; j++) {
x[0][j] -= x[2][j];
x[0][j] += x[3][j];
x[1][j] -= x[3][j];
x[1][j] += x[2][j];
}
long long c = x[0][0] * (100 + x[0][1])*(100 * (100 - min(x[0][2], 100LL)) + min(x[0][2], 100LL) * x[0][3])*(100 + x[0][4]);
long long d = x[1][0] * (100 + x[1][1])*(100 * (100 - min(x[1][2], 100LL)) + min(x[1][2], 100LL) * x[1][3])*(100 + x[1][4]);
if (c - a == 0)
printf("0\n");
else if (c > a)
printf("+\n");
else
printf("-\n");
if (d - b == 0)
printf("0\n");
else if (d > b)
printf("+\n");
else
printf("-\n");
return 0;
}