結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー tanimani364
提出日時 2021-03-29 16:31:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 608 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 182 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 67,812 KB
最終ジャッジ日時 2025-12-07 12:38:08
合計ジャッジ時間 2,903 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3
#coding:utf-8

import math
import string
import random
import heapq
from sys import stdin
# import numpy as np
# from matplotlib import pyplot as plt
	

def main():
	read=stdin.readline

	#edit here!
	a=list(map(int,read().split()))
	a.sort()
	maxv=10000001
	l=0
	r=maxv
	while r-l>1:
		mid=(l+r)//2
		if a[-1]<mid:
			r=mid;
		elif a[-1]>=mid and a[1]<mid:
			num=(a[-1]-mid)//2
			if num >=mid-a[1]+mid-a[0]:
				l=mid
			else :
				r=mid
		else:
			num=(a[-1]-mid)//2+(a[1]-mid)//2
			if num>=mid-a[0]:
				l=mid;
			else:
				r=mid
	print(l)




if __name__ == '__main__':
	main()
0