Submission #382925

# Submission time Handle Problem Language Result Execution time Memory
382925 2021-03-28T14:21:56 Z Alexandra Karte (COCI15_karte) Python 3
50 / 50
19 ms 3072 KB
s = input()
v = []
out = [13 for i in range (4)]
dupli = []

for i in range (0, len(s), 3):
  a = [s[i], int(s[i+1]+s[i+2])]
  v.append(a)

for i in range (len(v)):
  for j in range (len(v)):
    if i==j:
      continue
    elif v[i]==v[j]:
      if v[i] not in dupli:
        dupli.append(v[i])

if len(dupli)!=0:
  print ("GRESKA")

else:
  for i in range (len(v)):
    if v[i][0] == "P":
      out[0] -= 1
    elif v[i][0] == "K":
      out[1] -= 1
    elif v[i][0] == "H":
      out[2] -= 1
    elif v[i][0] == "T":
      out[3] -= 1
  
  print (str(out[0]) + " " + str(out[1]) + " " + str(out[2]) + " " + str(out[3]))
# Verdict Execution time Memory Grader output
1 Correct 17 ms 2924 KB Output is correct
2 Correct 16 ms 2924 KB Output is correct
3 Correct 19 ms 2924 KB Output is correct
4 Correct 18 ms 3052 KB Output is correct
5 Correct 17 ms 2924 KB Output is correct
6 Correct 18 ms 3072 KB Output is correct
7 Correct 17 ms 2924 KB Output is correct
8 Correct 17 ms 2924 KB Output is correct
9 Correct 17 ms 2924 KB Output is correct
10 Correct 17 ms 2924 KB Output is correct