From 71cd490b2824bb22975bff5b91f7e0a0d711f413 Mon Sep 17 00:00:00 2001 From: YOOBINNOH Date: Sat, 25 Jun 2022 21:30:24 +0900 Subject: [PATCH 1/8] (P)17659 --- .../(P)17659_python_\353\205\270\354\234\240\353\271\210.py" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "15\354\243\274\354\260\250/(P)17679/(P)17659_python_\353\205\270\354\234\240\353\271\210.py" diff --git "a/15\354\243\274\354\260\250/(P)17679/(P)17659_python_\353\205\270\354\234\240\353\271\210.py" "b/15\354\243\274\354\260\250/(P)17679/(P)17659_python_\353\205\270\354\234\240\353\271\210.py" new file mode 100644 index 0000000..e69de29 From 73749c8324628b89bdbd19cdd9b5371eedf6b613 Mon Sep 17 00:00:00 2001 From: YOOBINNOH Date: Sat, 25 Jun 2022 21:36:35 +0900 Subject: [PATCH 2/8] (P)72412 , 2146 --- .../(P)72412_python_\353\205\270\354\234\240\353\271\210.py" | 0 .../2146/2146_python_\353\205\270\354\234\240\353\271\210.py" | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 "15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" create mode 100644 "15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" diff --git "a/15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" "b/15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" new file mode 100644 index 0000000..e69de29 diff --git "a/15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" "b/15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" new file mode 100644 index 0000000..e69de29 From 4cd58815019909599a08717a81abece8858fa659 Mon Sep 17 00:00:00 2001 From: YOOBINNOH Date: Sat, 25 Jun 2022 21:48:57 +0900 Subject: [PATCH 3/8] 2146,(P)72412 --- .DS_Store | Bin 8196 -> 10244 bytes ...n_\353\205\270\354\234\240\353\271\210.py" | 0 ...n_\353\205\270\354\234\240\353\271\210.py" | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 "15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" create mode 100644 "15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" diff --git a/.DS_Store b/.DS_Store index 843c20c4ebd83317992f8e34dc010b96bc18961f..df338236cb4d1b3d092bd8585eab45c6e11d6653 100644 GIT binary patch delta 219 zcmZp1XbF&DU|?W$DortDU{C-uIe-{M3-C-V6q~50$SAonU^hRbrIC(;vGL@; zA~KAflLbWNIlEvwCOe3VZgvzt#DBby*I*eC`CZXoRna?!@Z@640=WdcQ*Anw!v bDPUw^FaXh$3uO8jEhqmIaolVwa)1c{65}*1 delta 97 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8E20o2aMAD7G Date: Sat, 25 Jun 2022 21:53:03 +0900 Subject: [PATCH 4/8] every file --- .DS_Store | Bin 8196 -> 10244 bytes ...n_\353\205\270\354\234\240\353\271\210.py" | 0 ...n_\353\205\270\354\234\240\353\271\210.py" | 0 ...n_\353\205\270\354\234\240\353\271\210.py" | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 "15\354\243\274\354\260\250/(P)17679/(P)17659_python_\353\205\270\354\234\240\353\271\210.py" create mode 100644 "15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" create mode 100644 "15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" diff --git a/.DS_Store b/.DS_Store index 843c20c4ebd83317992f8e34dc010b96bc18961f..df338236cb4d1b3d092bd8585eab45c6e11d6653 100644 GIT binary patch delta 219 zcmZp1XbF&DU|?W$DortDU{C-uIe-{M3-C-V6q~50$SAonU^hRbrIC(;vGL@; zA~KAflLbWNIlEvwCOe3VZgvzt#DBby*I*eC`CZXoRna?!@Z@640=WdcQ*Anw!v bDPUw^FaXh$3uO8jEhqmIaolVwa)1c{65}*1 delta 97 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8E20o2aMAD7G Date: Sat, 25 Jun 2022 21:56:06 +0900 Subject: [PATCH 5/8] 2 files --- ...n_\353\205\270\354\234\240\353\271\210.py" | 89 +++++++++++++++++++ ...n_\353\205\270\354\234\240\353\271\210.py" | 13 +++ 2 files changed, 102 insertions(+) diff --git "a/15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" "b/15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" index e69de29..364f0f4 100644 --- "a/15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" +++ "b/15\354\243\274\354\260\250/(P)72412/(P)72412_python_\353\205\270\354\234\240\353\271\210.py" @@ -0,0 +1,89 @@ + +# 정확성은 통과했지만 효율성을 통과하지 못했다. + + + +# 리스트 a,b 비교 함수 (Score 제외, 조건이 일치하는 않는 것이 하나라도 있으면 False 반환 ) + +def compare(a,b): + for i in range(0,len(b)): + if b[i] not in a: + return False + + return True + + +# Score 비교 함수 + +def score_compare(a,b): + a_score = "" + b_score = "" + + for i in range(0,len(a)): + if a[i].isdigit()==True: + a_score+=a[i] + + for i in range(0,len(b)): + if b[i].isdigit()==True: + b_score+=b[i] + + return int(a_score)>=int(b_score) + + + + +def solution(info, query): + answer = 0 + + ans = [] + + # 2차원 리스트 초기화 + + a = [[]*2 for i in range(len(query))] + + + # query의 각 항목들을 추출해서 리스트 a에 넣기 + + for i in range(len(query)): + if "cpp" in query[i]: + a[i].append("cpp") + + if "java" in query[i]: + a[i].append("java") + + if "python" in query[i]: + a[i].append("python") + + if "backend" in query[i]: + a[i].append("backend") + + if "frontend" in query[i]: + a[i].append("frontend") + + if "junior" in query[i]: + a[i].append("junior") + + if "senior" in query[i]: + a[i].append("senior") + + if "chicken" in query[i]: + a[i].append("chicken") + + if "pizza" in query[i]: + a[i].append("pizza") + + + + # compare 함수를 이용해서 조건에 맞는 answer 개수 세기 + + for i in range(0,len(a)): + for j in range(0,len(info)): + if compare(info[j],a[i])==True and score_compare(info[j],query[i])==True: + answer+=1 + ans.append(answer) + answer=0 + + + + + return ans diff --git "a/15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" "b/15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" index e69de29..ebefbe6 100644 --- "a/15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" +++ "b/15\354\243\274\354\260\250/2146/2146_python_\353\205\270\354\234\240\353\271\210.py" @@ -0,0 +1,13 @@ +# 잘 모르겠다.. + + + +# 첫 줄에는 지도의 크기 N(100이하의 자연수)가 주어진다. +# 그 다음 N줄에는 N개의 숫자가 빈칸을 사이에 두고 주어지며, 0은 바다, 1은 육지를 나타낸다. +# 항상 두 개 이상의 섬이 있는 데이터만 입력으로 주어진다. + + +N = int(input()) +map = input() + +# 각 섬 별 숫자를 다르게 표기하기 \ No newline at end of file From 74b9928cbceee2f8ba5358a2f94f236f9ee15fc0 Mon Sep 17 00:00:00 2001 From: YOOBINNOH Date: Sat, 2 Jul 2022 15:41:48 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[=EB=85=B8=EC=9C=A0=EB=B9=88]16=EC=A3=BC?= =?UTF-8?q?=EC=B0=A8=20=EA=B3=BC=EC=A0=9C=20=EC=A0=9C=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(P)17677_python_\353\205\270\354\234\240\353\271\210.py" | 0 .../(P)81302_python_\353\205\270\354\234\240\353\271\210.py" | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 "16\354\243\274\354\260\250/(P)17677/(P)17677_python_\353\205\270\354\234\240\353\271\210.py" create mode 100644 "16\354\243\274\354\260\250/(P)81302/(P)81302_python_\353\205\270\354\234\240\353\271\210.py" diff --git "a/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\353\205\270\354\234\240\353\271\210.py" "b/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\353\205\270\354\234\240\353\271\210.py" new file mode 100644 index 0000000..e69de29 diff --git "a/16\354\243\274\354\260\250/(P)81302/(P)81302_python_\353\205\270\354\234\240\353\271\210.py" "b/16\354\243\274\354\260\250/(P)81302/(P)81302_python_\353\205\270\354\234\240\353\271\210.py" new file mode 100644 index 0000000..e69de29 From 736ca80aafc3a700a541ff62c8e47572cd18fbfc Mon Sep 17 00:00:00 2001 From: YOOBINNOH Date: Sat, 2 Jul 2022 15:43:26 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[=EB=85=B8=EC=9C=A0=EB=B9=88]=2016=EC=A3=BC?= =?UTF-8?q?=EC=B0=A8=20final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n_\353\205\270\354\234\240\353\271\210.py" | 62 ++++++++++++++ ...n_\353\205\270\354\234\240\353\271\210.py" | 83 +++++++++++++++++++ 2 files changed, 145 insertions(+) diff --git "a/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\353\205\270\354\234\240\353\271\210.py" "b/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\353\205\270\354\234\240\353\271\210.py" index e69de29..d7a5b2c 100644 --- "a/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\353\205\270\354\234\240\353\271\210.py" +++ "b/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\353\205\270\354\234\240\353\271\210.py" @@ -0,0 +1,62 @@ +def solution(str1, str2): + + answer = 0 + + # 알파벳 리스트 + m = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] + + # 각 문자열 소문자로 변환 후 리스트에 담기 + a = list(str1.lower()) + b = list(str2.lower()) + + # 조건 만족하는 값들만 담을 리스트 생성 + final_a = [ ] + final_b = [ ] + + # a 에서 조건 만족 하는 값들만 final에 담기 + + for i in range(0,len(a)-1): + if a[i] in m and a[i+1] in m: + final_a.append(a[i]+a[i+1]) + + # b 에서 조건 만족 하는 값들만 final에 담기 + + for i in range(0,len(b)-1): + if b[i] in m and b[i+1] in m: + final_b.append(b[i]+b[i+1]) + + inter = [ ] # 교집합 + outer = final_a+final_b # 합집합 + outer = list(set(outer)) + + final_inter = [ ] + final_outer = [ ] + + + + # 일반 교집합 구하기 + + for i in range(0,len(final_a)): + if final_a[i] in final_b: + inter.append(final_a[i]) + + # 일반 교집합 중복 제거 + + inter = list(set(inter)) + + # 자카드 교집합 구하기 + + for i in range(0,len(inter)): + for j in range(min(final_a.count(inter[i]),final_b.count(inter[i]))): + final_inter.append(inter[i]) + + + + for i in range(0,len(outer)): + for j in range(max(final_a.count(outer[i]),final_b.count(outer[i]))): + final_outer.append(outer[i]) + + if len(final_outer)==0: + return 65536 + + return int((len(final_inter)/len(final_outer))*65536) \ No newline at end of file diff --git "a/16\354\243\274\354\260\250/(P)81302/(P)81302_python_\353\205\270\354\234\240\353\271\210.py" "b/16\354\243\274\354\260\250/(P)81302/(P)81302_python_\353\205\270\354\234\240\353\271\210.py" index e69de29..dce26b1 100644 --- "a/16\354\243\274\354\260\250/(P)81302/(P)81302_python_\353\205\270\354\234\240\353\271\210.py" +++ "b/16\354\243\274\354\260\250/(P)81302/(P)81302_python_\353\205\270\354\234\240\353\271\210.py" @@ -0,0 +1,83 @@ +def solution(places): + answer = [] + + # 각 고사장 별 사람 위치 리스트 + + one = [] + two = [] + three = [] + four = [] + five = [] + # 실패. 사람들 위치, 파티션 위치를 좌표로 구했지만 그 이후 방법을 모르겠음. + + + # 각 고사장 별 파티션 위치 리스트 + one_p = [] + two_p = [] + three_p = [] + four_p = [] + five_p = [] + + + # places[0] 의 사람, 파티션 좌표 구하기 + + a = places[0] + + for i in range(0,5): + b = list(a[i]) + for j in range(0,5): + if b[j]=='P': + one.append([i,j]) + if b[j]=='X': + one_p.append([i,j]) + + # places[1] 의 사람, 파티션 좌표 구하기 + + c = places[0] + + for i in range(0,5): + d = list(c[i]) + for j in range(0,5): + if d[j]=='P': + two.append([i,j]) + if d[j]=='X': + two_p.append([i,j]) + + # places[2] 의 사람, 파티션 좌표 구하기 + + e = places[0] + + for i in range(0,5): + f = list(e[i]) + for j in range(0,5): + if f[j]=='P': + three.append([i,j]) + if f[j]=='X': + three_p.append([i,j]) + + + # places[3] 의 사람, 파티션 좌표 구하기 + + g = places[0] + + for i in range(0,5): + h = list(g[i]) + for j in range(0,5): + if h[j]=='P': + four.append([i,j]) + if h[j]=='X': + four_p.append([i,j]) + + # places[4] 의 사람, 파티션 좌표 구하기 + + q = places[0] + + for i in range(0,5): + w = list(q[i]) + for j in range(0,5): + if w[j]=='P': + five.append([i,j]) + if w[j]=='X': + five_p.append([i,j]) + + return four_p \ No newline at end of file From 1c71857cb7ed7643a6897dbb185412e8e15a80d9 Mon Sep 17 00:00:00 2001 From: Bini <76957075+YOOBINNOH@users.noreply.github.com> Date: Sat, 2 Jul 2022 15:44:40 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[=EB=85=B8=EC=9C=A0=EB=B9=88]=2016=EC=A3=BC?= =?UTF-8?q?=EC=B0=A8=20=EA=B3=BC=EC=A0=9C=20=EC=A0=9C=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...62\341\204\207\341\205\265\341\206\253.py" | 62 ++++++++++++++ ...62\341\204\207\341\205\265\341\206\253.py" | 83 +++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 "16\354\243\274\354\260\250/(P)17677/(P)17677_python_\341\204\202\341\205\251\341\204\213\341\205\262\341\204\207\341\205\265\341\206\253.py" create mode 100644 "16\354\243\274\354\260\250/(P)17677/(P)81302_python_\341\204\202\341\205\251\341\204\213\341\205\262\341\204\207\341\205\265\341\206\253.py" diff --git "a/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\341\204\202\341\205\251\341\204\213\341\205\262\341\204\207\341\205\265\341\206\253.py" "b/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\341\204\202\341\205\251\341\204\213\341\205\262\341\204\207\341\205\265\341\206\253.py" new file mode 100644 index 0000000..d7a5b2c --- /dev/null +++ "b/16\354\243\274\354\260\250/(P)17677/(P)17677_python_\341\204\202\341\205\251\341\204\213\341\205\262\341\204\207\341\205\265\341\206\253.py" @@ -0,0 +1,62 @@ +def solution(str1, str2): + + answer = 0 + + # 알파벳 리스트 + m = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] + + # 각 문자열 소문자로 변환 후 리스트에 담기 + a = list(str1.lower()) + b = list(str2.lower()) + + # 조건 만족하는 값들만 담을 리스트 생성 + final_a = [ ] + final_b = [ ] + + # a 에서 조건 만족 하는 값들만 final에 담기 + + for i in range(0,len(a)-1): + if a[i] in m and a[i+1] in m: + final_a.append(a[i]+a[i+1]) + + # b 에서 조건 만족 하는 값들만 final에 담기 + + for i in range(0,len(b)-1): + if b[i] in m and b[i+1] in m: + final_b.append(b[i]+b[i+1]) + + inter = [ ] # 교집합 + outer = final_a+final_b # 합집합 + outer = list(set(outer)) + + final_inter = [ ] + final_outer = [ ] + + + + # 일반 교집합 구하기 + + for i in range(0,len(final_a)): + if final_a[i] in final_b: + inter.append(final_a[i]) + + # 일반 교집합 중복 제거 + + inter = list(set(inter)) + + # 자카드 교집합 구하기 + + for i in range(0,len(inter)): + for j in range(min(final_a.count(inter[i]),final_b.count(inter[i]))): + final_inter.append(inter[i]) + + + + for i in range(0,len(outer)): + for j in range(max(final_a.count(outer[i]),final_b.count(outer[i]))): + final_outer.append(outer[i]) + + if len(final_outer)==0: + return 65536 + + return int((len(final_inter)/len(final_outer))*65536) \ No newline at end of file diff --git "a/16\354\243\274\354\260\250/(P)17677/(P)81302_python_\341\204\202\341\205\251\341\204\213\341\205\262\341\204\207\341\205\265\341\206\253.py" "b/16\354\243\274\354\260\250/(P)17677/(P)81302_python_\341\204\202\341\205\251\341\204\213\341\205\262\341\204\207\341\205\265\341\206\253.py" new file mode 100644 index 0000000..dce26b1 --- /dev/null +++ "b/16\354\243\274\354\260\250/(P)17677/(P)81302_python_\341\204\202\341\205\251\341\204\213\341\205\262\341\204\207\341\205\265\341\206\253.py" @@ -0,0 +1,83 @@ +def solution(places): + answer = [] + + # 각 고사장 별 사람 위치 리스트 + + one = [] + two = [] + three = [] + four = [] + five = [] + # 실패. 사람들 위치, 파티션 위치를 좌표로 구했지만 그 이후 방법을 모르겠음. + + + # 각 고사장 별 파티션 위치 리스트 + one_p = [] + two_p = [] + three_p = [] + four_p = [] + five_p = [] + + + # places[0] 의 사람, 파티션 좌표 구하기 + + a = places[0] + + for i in range(0,5): + b = list(a[i]) + for j in range(0,5): + if b[j]=='P': + one.append([i,j]) + if b[j]=='X': + one_p.append([i,j]) + + # places[1] 의 사람, 파티션 좌표 구하기 + + c = places[0] + + for i in range(0,5): + d = list(c[i]) + for j in range(0,5): + if d[j]=='P': + two.append([i,j]) + if d[j]=='X': + two_p.append([i,j]) + + # places[2] 의 사람, 파티션 좌표 구하기 + + e = places[0] + + for i in range(0,5): + f = list(e[i]) + for j in range(0,5): + if f[j]=='P': + three.append([i,j]) + if f[j]=='X': + three_p.append([i,j]) + + + # places[3] 의 사람, 파티션 좌표 구하기 + + g = places[0] + + for i in range(0,5): + h = list(g[i]) + for j in range(0,5): + if h[j]=='P': + four.append([i,j]) + if h[j]=='X': + four_p.append([i,j]) + + # places[4] 의 사람, 파티션 좌표 구하기 + + q = places[0] + + for i in range(0,5): + w = list(q[i]) + for j in range(0,5): + if w[j]=='P': + five.append([i,j]) + if w[j]=='X': + five_p.append([i,j]) + + return four_p \ No newline at end of file