Skip to content

Commit

Permalink
2024-12-02
Browse files Browse the repository at this point in the history
  • Loading branch information
H0ngJu committed Dec 2, 2024
1 parent 2ae6037 commit 2d40825
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion H0ngJu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
21 changes: 21 additions & 0 deletions H0ngJu/수학/머리 톡톡.py
Original file line number Diff line number Diff line change
@@ -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=" ")

0 comments on commit 2d40825

Please sign in to comment.