Skip to content

Commit

Permalink
30-yuna83
Browse files Browse the repository at this point in the history
  • Loading branch information
yuna83 committed Feb 19, 2024
1 parent eda9e3b commit 276008a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yuna83/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@
| 26μ°¨μ‹œ | 2024.01.30 | λ”•μ…”λ„ˆλ¦¬ | [κ·€ κ³ λ₯΄κΈ°](https://school.programmers.co.kr/learn/courses/30/lessons/138476)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/125|
| 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|
---
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 276008a

Please sign in to comment.