Skip to content

Commit

Permalink
Merge pull request #141 from yuna83/30-yuna83
Browse files Browse the repository at this point in the history
30-yuna83
  • Loading branch information
yuna83 authored Mar 4, 2024
2 parents 7138d16 + a349dc8 commit 323ab91
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions yuna83/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
| 27μ°¨μ‹œ | 2024.02.05 | νˆ¬ν¬μΈν„° | [μ’‹λ‹€](https://www.acmicpc.net/problem/1253)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/129|
| 28μ°¨μ‹œ | 2024.02.07 | νˆ¬ν¬μΈν„° | [ꡬλͺ…λ³΄νŠΈ](https://school.programmers.co.kr/learn/courses/30/lessons/42885)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/134|
| 29μ°¨μ‹œ | 2024.02.13 | μŠ¬λΌμ΄λ”©μœˆλ„μš° | [λΈ”λ‘œκ·Έ](https://www.acmicpc.net/problem/21921)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/136|
| 29μ°¨μ‹œ | 2024.02.19 | μŠ¬λΌμ΄λ”©μœˆλ„μš° | [도둑](https://www.acmicpc.net/problem/13422)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/141|
| 30μ°¨μ‹œ | 2024.02.19 | μŠ¬λΌμ΄λ”©μœˆλ„μš° | [도둑](https://www.acmicpc.net/problem/13422)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/141|
| 31μ°¨μ‹œ | 2024.02.23 | DFS/BFS | [λ°”μ΄λŸ¬μŠ€](https://www.acmicpc.net/problem/2606)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/145|
---
27 changes: 27 additions & 0 deletions yuna83/μŠ¬λΌμ΄λ”©μœˆλ„μš°/도둑.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import sys
input=sys.stdin.readline

t=int(input())
for i in range(t):
n,m,k=map(int,input().split())
home=list(map(int,input().split()))

if m!=n:
for j in range(m-1):
home.append(home[j])

start= 0
end=m-1
count=sum(home[:m])
answer=0

if count<k: # μ‹œμž‘ μœˆλ„μš° 확인
answer+=1
while end<len(home)-1:
count-=home[start]
start+=1
end+=1
count+=home[end]
if count<k:
answer+=1
print(answer)

0 comments on commit 323ab91

Please sign in to comment.