'17952' 태그의 글 목록
본문 바로가기

노트

검색하기
노트
프로필사진 _Myway

  • 분류 전체보기 (49)
    • 코딩 (16)
      • Raspberry Pi (2)
      • Python (4)
      • Node.js (2)
      • 웹 프론트 (3)
      • Ubuntu|Linux (1)
      • MongoDB|mongoose (2)
      • GitLab (1)
      • Springboot (1)
    • 알고리즘 (33)
Guestbook
Notice
  • 도움이 되셨다면 공감버튼 한번씩 부탁드려요!
Recent Posts
Recent Comments
Link
«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
  • node.js
  • 알고리즘
  • Algorythm
  • 2909
  • springboot3.x
  • 크롤링
  • raspberrypi
  • 2579
  • dp
  • dynaminprogramming
  • 라즈베리파이
  • 13237
  • HTML
  • Python
  • 라즈베리파이3b+
  • algotythm
  • 트리
  • bootstrap
  • ubuntu
  • 16.04
  • 백준
  • nav-tab
  • baekjun
  • MongoDB
  • CSS
  • 라즈베리파이3
  • 라즈비안
  • NAV
  • 파이썬
  • Crawling
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록17952 (1)

노트

[백준] 17952번 과제는 끝나지 않아! python

자꾸 시간초과가 나서 readline 추가 import sys input = sys.stdin.readline n = int(input()) hw = [] final_score = 0 idx = 0 for _ in range(n): line = list(map(int,input().split())) if line[0]==1: if line[2]-1==0: final_score += line[1] else: hw.append([line[1],line[2]-1]) idx += 1 else: if len(hw)>0: hw[idx-1][1] -= 1 if hw[idx-1][1]==0: score, time = hw.pop() final_score+=score idx -= 1 print(final_score)

알고리즘 2023. 6. 1. 23:03
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바