From 8533316c30009536bc4c7377233de04b0d757d15 Mon Sep 17 00:00:00 2001 From: Gyubin Han <89185979+Gyubin-Han@users.noreply.github.com> Date: Fri, 24 May 2024 15:07:21 +0900 Subject: [PATCH] add: swea/4047.py --- swea/4047.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 swea/4047.py diff --git a/swea/4047.py b/swea/4047.py new file mode 100644 index 0000000..51ccd71 --- /dev/null +++ b/swea/4047.py @@ -0,0 +1,24 @@ +t=int(input()) +for tc in range(1,t+1): + isCo=True + c=set() + d={} + p=input() + pl=len(p)//3 + for i in range(pl): + v=p[i*3:i*3+3] + if v in c: + isCo=False + break + c.add(v) + d[v[0]]=d.get(v[0],0)+1 + + if not isCo: + print("#"+str(tc),"ERROR") + continue + cs=13-d.get('S',0) + cd=13-d.get('D',0) + ch=13-d.get('H',0) + cc=13-d.get('C',0) + + print("#"+str(tc),cs,cd,ch,cc)