From 79b09c1a5c842c8af7ca02ff7f75841b3cbc6236 Mon Sep 17 00:00:00 2001 From: Gyubin Han <89185979+Gyubin-Han@users.noreply.github.com> Date: Thu, 9 May 2024 01:51:26 +0900 Subject: [PATCH] add: swea/1204.py --- swea/1204.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 swea/1204.py diff --git a/swea/1204.py b/swea/1204.py new file mode 100644 index 0000000..a7e1cbf --- /dev/null +++ b/swea/1204.py @@ -0,0 +1,17 @@ +t=int(input()) + +for _ in range(1,t+1): + tc=int(input()) + arr=list(map(int,input().split())) + cnt={} + mx=(0,0) + + for i in arr: + if i in cnt: + cnt[i]+=1 + else: + cnt[i]=1 + + if cnt[i]>mx[1] or (cnt[i]==mx[1] and i>mx[0]): + mx=(i,cnt[i]) + print("#"+str(tc),mx[0])