-
[python]백준 두 수의 합 3273번알고리즘 문제풀이/백준(파이썬) 2023. 5. 6. 21:44
코드
import sys input = sys.stdin.readline sys.stdin = open("3273.txt", "r") n=int(input()) q=list(map(int,input().split())) w=int(input()) s=0 q.sort() for i in range(n): for j in range(i+1,n): if q[i]+q[j]==w:#시작이 0인덱스, 1인덱스 s+=1 elif q[i]+q[j]>w: break print(s) #PyPy3
링크
https://www.acmicpc.net/problem/3273
'알고리즘 문제풀이 > 백준(파이썬)' 카테고리의 다른 글
[python]백준 그릇 7567번 (0) 2023.05.08 [python]백준 수학은 체육과목 입니다 15894번 (0) 2023.05.07 [python]백준 멘토와 멘티 26265번 (0) 2023.05.05 [python]백준 2009년 2948번 (0) 2023.05.04 [python]백준 2007년 1924번 (0) 2023.05.04