-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a99212c
commit e32b4f0
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Bela | ||
# Solution by Hasan Kalzi 08-10-2020 | ||
# Link to the problem in Kattis: https://open.kattis.com/problems/bela | ||
from sys import stdin, stdout | ||
|
||
n, b = stdin.readline().strip().split(" ") | ||
score = 0 | ||
for _ in range(int(n) * 4): | ||
values = stdin.readline().strip() | ||
if values[0] == "A": | ||
score += 11 | ||
elif values[0] == "K": | ||
score += 4 | ||
elif values[0] == "Q": | ||
score += 3 | ||
elif values[0] == "J": | ||
if values[1] == b: | ||
score += 20 | ||
else: | ||
score += 2 | ||
elif values[0] == "T": | ||
score += 10 | ||
elif values[0] == "9": | ||
if values[1] == b: | ||
score += 14 | ||
stdout.write(str(score)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Bela | ||
# Solution by Hasan Kalzi 08-10-2020 | ||
# Link to the problem in Kattis: https://open.kattis.com/problems/bela | ||
|
||
game_values = input().split(" ") | ||
score = 0 | ||
for _ in range(int(game_values[0])*4): | ||
values = input() | ||
if values[0] == "A": | ||
score += 11 | ||
elif values[0] == "K": | ||
score += 4 | ||
elif values[0] == "Q": | ||
score += 3 | ||
elif values[0] == "J": | ||
if values[1] == game_values[1]: | ||
score += 20 | ||
else: | ||
score += 2 | ||
elif values[0] == "T": | ||
score += 10 | ||
elif values[0] == "9": | ||
if values[1] == game_values[1]: | ||
score += 14 | ||
print(score) |