repl.it
@Lord_Poseidon/

coding task thing

Python

No description

fork
loading
Files
  • main.py
  • 1.py
  • 2.py
  • 3.py
  • file.txt
  • filo.txt
  • interactive_runner.py
  • printo.py
  • testing_tool.py
main.py
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
def standardize(m):
  max_len=max([len(i) for i in m])
  ret=[]
  for i in m:
    if len(i) != max_len:
      q=max_len//len(i)
      r=max_len%len(i)
      ret.append(q*i+i[:r])
    else:
      ret.append(i)
  return ret
for o in range(int(input())):
  numo=int(input())
  progs=[]
  ans=''
  for i in range(numo):
    progs.append(input())
  progs=standardize(progs)
  for i in range(len(progs[0])):
    r=[j[i] for j in progs]
    if len(set(r))==3:
      print('Case #'+str(o+1)+': IMPOSSIBLE')
      break
      continue
    if len(set(r))==2:
      r=list(set(r))
      f='RPS'
      ans= ans+[][0]
      
  if ans !='':
    print('Case #'+str(o+1)+': '+ans)
  
?