結果

問題 No.91 赤、緑、青の石
ユーザー tanimani364tanimani364
提出日時 2021-03-29 16:31:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 5,000 ms
コード長 608 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 81,204 KB
最終ジャッジ日時 2023-09-06 12:55:04
合計ジャッジ時間 6,789 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 161 ms
81,204 KB
testcase_01 AC 168 ms
81,036 KB
testcase_02 AC 163 ms
80,928 KB
testcase_03 AC 162 ms
81,140 KB
testcase_04 AC 159 ms
81,128 KB
testcase_05 AC 161 ms
81,036 KB
testcase_06 AC 162 ms
81,156 KB
testcase_07 AC 163 ms
80,852 KB
testcase_08 AC 161 ms
81,032 KB
testcase_09 AC 163 ms
81,012 KB
testcase_10 AC 161 ms
81,128 KB
testcase_11 AC 159 ms
80,972 KB
testcase_12 AC 162 ms
80,936 KB
testcase_13 AC 161 ms
80,808 KB
testcase_14 AC 163 ms
81,128 KB
testcase_15 AC 163 ms
81,120 KB
testcase_16 AC 162 ms
81,124 KB
testcase_17 AC 163 ms
81,032 KB
testcase_18 AC 164 ms
81,196 KB
testcase_19 AC 163 ms
81,016 KB
testcase_20 AC 160 ms
81,032 KB
testcase_21 AC 162 ms
81,044 KB
testcase_22 AC 162 ms
81,168 KB
testcase_23 AC 163 ms
81,128 KB
testcase_24 AC 162 ms
81,184 KB
testcase_25 AC 159 ms
81,152 KB
testcase_26 AC 163 ms
81,084 KB
testcase_27 AC 163 ms
80,972 KB
testcase_28 AC 161 ms
80,956 KB
testcase_29 AC 163 ms
80,776 KB
testcase_30 AC 162 ms
80,972 KB
testcase_31 AC 164 ms
81,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/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