first commit

from old repository to a new repository
This commit is contained in:
Gyubin Han
2024-04-30 16:59:10 +09:00
commit 2600340c03
93 changed files with 1610 additions and 0 deletions

24
boj/3273.py Normal file
View File

@@ -0,0 +1,24 @@
import sys
n=int(sys.stdin.readline().rstrip())
arr=list(map(int,sys.stdin.readline().rstrip().split()))
x=int(sys.stdin.readline().rstrip())
count=0
start=0
end=n-1
arr.sort()
while True:
if start==end:
break
res=arr[start]+arr[end]
if res==x:
count+=1
end-=1
elif res>x:
end-=1
else:
start+=1
print(count)