Skip to content

Commit

Permalink
Merge pull request #260 from AlgoLeadMe/36-H0ngJu
Browse files Browse the repository at this point in the history
36-H0ngJu
  • Loading branch information
H0ngJu authored Dec 31, 2024
2 parents 7b0570c + 2d40825 commit b941599
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions H0ngJu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
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 b941599

Please sign in to comment.