From 2ae603773f74802415b05624ee495c7de6857f70 Mon Sep 17 00:00:00 2001 From: H0ngJu Date: Mon, 2 Dec 2024 09:51:38 +0900 Subject: [PATCH 1/2] =?UTF-8?q?md=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- H0ngJu/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/H0ngJu/README.md b/H0ngJu/README.md index 68c4dfe..7adc787 100644 --- a/H0ngJu/README.md +++ b/H0ngJu/README.md @@ -37,3 +37,4 @@ | 33차시 | 2024.11.08 | 백트래킹 | [병원 거리 최소화](https://www.codetree.ai/training-field/frequent-problems/problems/min-of-hospital-distance/submissions?page=11&pageSize=5) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/253 | | 34차시 | 2024.11.19 | 누적합 | [개똥벌레](https://www.acmicpc.net/problem/3020) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/256 | | 35차시 | 2024.11.23 | DP | [전깃줄](https://www.acmicpc.net/problem/2565) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/258 | +| 36차시 | 2024.12.02 | | [머리 톡톡](https://www.acmicpc.net/problem/1241) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/260 | From 2d4082573bfe492240931f364558012b583dce40 Mon Sep 17 00:00:00 2001 From: H0ngJu Date: Mon, 2 Dec 2024 20:44:35 +0900 Subject: [PATCH 2/2] 2024-12-02 --- H0ngJu/README.md | 2 +- ...0\353\246\254 \355\206\241\355\206\241.py" | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 "H0ngJu/\354\210\230\355\225\231/\353\250\270\353\246\254 \355\206\241\355\206\241.py" diff --git a/H0ngJu/README.md b/H0ngJu/README.md index 7adc787..b9d0d9a 100644 --- a/H0ngJu/README.md +++ b/H0ngJu/README.md @@ -37,4 +37,4 @@ | 33차시 | 2024.11.08 | 백트래킹 | [병원 거리 최소화](https://www.codetree.ai/training-field/frequent-problems/problems/min-of-hospital-distance/submissions?page=11&pageSize=5) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/253 | | 34차시 | 2024.11.19 | 누적합 | [개똥벌레](https://www.acmicpc.net/problem/3020) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/256 | | 35차시 | 2024.11.23 | DP | [전깃줄](https://www.acmicpc.net/problem/2565) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/258 | -| 36차시 | 2024.12.02 | | [머리 톡톡](https://www.acmicpc.net/problem/1241) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/260 | +| 36차시 | 2024.12.02 | 수학 | [머리 톡톡](https://www.acmicpc.net/problem/1241) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/260 | diff --git "a/H0ngJu/\354\210\230\355\225\231/\353\250\270\353\246\254 \355\206\241\355\206\241.py" "b/H0ngJu/\354\210\230\355\225\231/\353\250\270\353\246\254 \355\206\241\355\206\241.py" new file mode 100644 index 0000000..86492a1 --- /dev/null +++ "b/H0ngJu/\354\210\230\355\225\231/\353\250\270\353\246\254 \355\206\241\355\206\241.py" @@ -0,0 +1,21 @@ +import sys + +def input() : return sys.stdin.readline().rstrip() + +N = int(input()) +students = [int(input()) for _ in range(N)] +hits = [0 for _ in range(1000001)] +results = [0 for _ in range(N)] + +for student in students: + hits[student] += 1 + +for idx in range(len(students)): + for i in range(1, int(students[idx]**(1/2)) + 1): + if students[idx] % i == 0: + results[idx] += hits[i] + if (i ** 2) != students[idx]: + results[idx] += hits[students[idx] // i] + +for r in results: + print(r-1, end=" ") \ No newline at end of file