From 41737e705f251721c017f141ea7e21a00bc2671d Mon Sep 17 00:00:00 2001 From: wonilHeo Date: Fri, 15 Jul 2022 18:07:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[3=EC=A3=BC=EC=B0=A8]=20:=20=ED=97=88?= =?UTF-8?q?=EC=9B=90=EC=9D=BC=20-=205883=20=EC=95=84=EC=9D=B4=ED=8F=B0=209?= =?UTF-8?q?S=20Silver4=20(#60)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\354\225\204\354\235\264\355\217\2609S.py" | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 "\355\227\210\354\233\220\354\235\274/5883 \354\225\204\354\235\264\355\217\2609S.py" diff --git "a/\355\227\210\354\233\220\354\235\274/5883 \354\225\204\354\235\264\355\217\2609S.py" "b/\355\227\210\354\233\220\354\235\274/5883 \354\225\204\354\235\264\355\217\2609S.py" new file mode 100644 index 0000000..c7ab5b6 --- /dev/null +++ "b/\355\227\210\354\233\220\354\235\274/5883 \354\225\204\354\235\264\355\217\2609S.py" @@ -0,0 +1,28 @@ +N = int(input()) +line = [] # 줄 정보 +long_seq = [] + +# 최대길이를 계산하는 함수 +def max_seq_cap(line): + max_count = 1 + count = 1 + for i in range(0, len(line)-1): + if line[i] == line[i+1]: # 연속된 두 원소가 같으면 count 증가 + count += 1 + else: # 다르면 max_count 초기화 + max_count = max(count, max_count) + count = 1 # count 초기화 + return max(count, max_count) # 예외처리 - new_line이 한 용량으로만 이루어진 경우 + +for _ in range(N): + cap = int(input()) + line.append(cap) +set = set(line) # 줄에 있는 구매자들이 원하는 용량종류를 담는 집합 + +for element in set: + new_line = line.copy() # line을 복사해 new_line을 생성 + while element in new_line: # 특정 용량을 원하는 사람을 모두 뺌 + new_line.remove(element) + long_seq.append(max_seq_cap(new_line)) + +print(max(long_seq)) \ No newline at end of file From aadafe658f3f24c0e7e172b63eebe85c11b9f107 Mon Sep 17 00:00:00 2001 From: wonilHeo Date: Fri, 15 Jul 2022 18:10:22 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[3=EC=A3=BC=EC=B0=A8]=20:=20=ED=97=88?= =?UTF-8?q?=EC=9B=90=EC=9D=BC=20-=2018247=20=EA=B2=A8=EC=9A=B8=EC=99=95?= =?UTF-8?q?=EA=B5=AD=20=ED=8B=B0=EC=BC=93=20=EC=98=88=EB=A7=A4=20Bronze3?= =?UTF-8?q?=20(#60)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5 \355\213\260\354\274\223 \354\230\210\353\247\244.py" | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 "\355\227\210\354\233\220\354\235\274/18247 \352\262\250\354\232\270\354\231\225\352\265\255 \355\213\260\354\274\223 \354\230\210\353\247\244.py" diff --git "a/\355\227\210\354\233\220\354\235\274/18247 \352\262\250\354\232\270\354\231\225\352\265\255 \355\213\260\354\274\223 \354\230\210\353\247\244.py" "b/\355\227\210\354\233\220\354\235\274/18247 \352\262\250\354\232\270\354\231\225\352\265\255 \355\213\260\354\274\223 \354\230\210\353\247\244.py" new file mode 100644 index 0000000..053a836 --- /dev/null +++ "b/\355\227\210\354\233\220\354\235\274/18247 \352\262\250\354\232\270\354\231\225\352\265\255 \355\213\260\354\274\223 \354\230\210\353\247\244.py" @@ -0,0 +1,7 @@ +n = int(input()) +for _ in range(n): + N, M = map(int, input().split()) + if N < 12 or M < 4: # L4 자리가 존재할 수 없는 경우 + print(-1) + else: + print(M*11 + 4) \ No newline at end of file From b1d34bd6227bb1d6cec0595cee984d6decb1f4a7 Mon Sep 17 00:00:00 2001 From: wonilHeo Date: Fri, 15 Jul 2022 18:17:32 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[3=EC=A3=BC=EC=B0=A8]=20:=20=ED=97=88?= =?UTF-8?q?=EC=9B=90=EC=9D=BC=20-=20=EC=98=A4=ED=94=88=EC=B1=84=ED=8C=85?= =?UTF-8?q?=EB=B0=A9=20lv.2=20(#60)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...10\354\261\204\355\214\205\353\260\251.py" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "\355\227\210\354\233\220\354\235\274/\354\230\244\355\224\210\354\261\204\355\214\205\353\260\251.py" diff --git "a/\355\227\210\354\233\220\354\235\274/\354\230\244\355\224\210\354\261\204\355\214\205\353\260\251.py" "b/\355\227\210\354\233\220\354\235\274/\354\230\244\355\224\210\354\261\204\355\214\205\353\260\251.py" new file mode 100644 index 0000000..b50e858 --- /dev/null +++ "b/\355\227\210\354\233\220\354\235\274/\354\230\244\355\224\210\354\261\204\355\214\205\353\260\251.py" @@ -0,0 +1,19 @@ +def solution(record): + answer = [] + uid_arch = {} # 유저아이디 : 닉네임 을 저장하는 딕셔너리 + + # 반복문을 돌며 기록 처리 + for rec in record: + rec_splited = rec.split() + if (rec_splited[0] == 'Enter') or (rec_splited[0] =='Change'): + uid_arch[rec_splited[1]] = rec_splited[2] + + # 반복문을 돌며 처리된 기록을 바탕으로 메시지 저장 + for rec in record: + rec_splited = rec.split() + if rec_splited[0] == 'Enter': + answer.append(f"{uid_arch[rec_splited[1]]}님이 들어왔습니다.") + elif rec_splited[0] == 'Leave': + answer.append(f"{uid_arch[rec_splited[1]]}님이 나갔습니다.") + + return answer \ No newline at end of file