회원가입
로그인
Toggle navigation
문제
문제
전체 문제
문제 출처
단계별로 풀어보기
알고리즘 분류
추가된 문제
문제 순위
문제
푼 사람이 한 명인 문제
아무도 못 푼 문제
최근 제출된 문제
최근 풀린 문제
랜덤
출처
ICPC
Olympiad
한국정보올림피아드
한국정보올림피아드시․도지역본선
전국 대학생 프로그래밍 대회 동아리 연합
대학교 대회
카카오 코드 페스티벌
Coder's High
ICPC
Regionals
World Finals
Korea Regional
Africa and the Middle East Regionals
Europe Regionals
Latin America Regionals
North America Regionals
South Pacific Regionals
문제집
대회
채점 현황
게시판
그룹
더 보기
재채점 기록
블로그
도움말
전체
공지
자유
질문
오타/오역/요청
게시판 공지
홍보
업데이트
solved.ac
글쓰기
질문 도움말
자주묻는 질문
어떤 부분이 틀렸는지 모르겠습니다. ㅜㅠㅠ
17420번 - 깊콘이 넘쳐흘러
slue0412
2년 전
0
2% 정도에서 틀렸습니다. 알람을 나타냅니다. 어디부분에서 틀린것인지 모르겠습니다. 도와주세요!
import sys def time_extend(PRE_MAP,ind ): global N the_day = PRE_MAP[ind][1] if PRE_MAP[ind][0] < the_day : while(PRE_MAP[ind][0]< the_day): PRE_MAP[ind][0] +=extend_time for i in range(ind, N): if PRE_MAP[i][0] < PRE_MAP[ind][0] : while(PRE_MAP[i][0]<PRE_MAP[ind][0]): PRE_MAP[i][0] +=extend_time def use_coupon(PRE_MAP,ind): global N min_day = PRE_MAP[ind][1] i = ind while(PRE_MAP[i][1]==min_day ) : i +=1 if i ==N : break return i def whatshoulddo(PRE_MAP,ind) : min_x =1000000001 min_y =PRE_MAP[ind][1] for i in range(ind,N): if min_x > PRE_MAP[i][0]: min_x = PRE_MAP[i][0] if min_x < min_y : return False ## extend_time else : return True ## use cuopon N = int(input()) extend_time = 30 remain_M = list(map(int,sys.stdin.readline().split())) schedual_M = list(map(int,sys.stdin.readline().split())) PRE_MAP = list() for i in range(N): PRE_MAP.append([remain_M[i], schedual_M[i]]) PRE_MAP.sort(key=lambda x: (x[1],x[0])) ind =0 count =0 while(ind <N): if whatshoulddo(PRE_MAP,ind) : ind = use_coupon(PRE_MAP,ind) count+=1 else : time_extend(PRE_MAP,ind) count+=1 print(count)
댓글을 작성하려면
로그인
해야 합니다.
slue0412 2년 전
2% 정도에서 틀렸습니다. 알람을 나타냅니다. 어디부분에서 틀린것인지 모르겠습니다. 도와주세요!