대상이 되는 알고리즘 문제, 백준알고리즘 1912번
(https://www.acmicpc.net/problem/1912)
파이썬3를 쓸때, 입력을 한번에 리스트로 저장하고 싶을때는?
파이썬2보다 문법들이 조금씩 바뀌고, 라이브러리도 호환이 잘 안되어서 어려움을 겪은 기억이 있는데, 어쨌든 아래와 같다.
10
10 -4 3 1 5 6 -35 12 21 -1
만약 int로 컨버전을 해주지 않는다면, 스트링 형태로 들어가게 된다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.stdin = open("inputs/1912.txt") | |
############################################ | |
N = int(input()) | |
l = list(map(int,input().split())) |
'소프트웨어 개발 > Python' 카테고리의 다른 글
pip pandas 설치시 에러하나 (0) | 2018.04.24 |
---|---|
Django Google Cloud App Engine 써보기 (0) | 2018.03.26 |
파이썬3 표준입출력 파일로부터. (0) | 2016.10.22 |
InMemoryUploaded 파일 -> 수정 -> 모델 저장 (0) | 2016.01.01 |
cannot write mode F as PNG (0) | 2016.01.01 |