Submission #1839578


Source Code Expand

N,M=map(int,input().split())

res=-1
left=0
right=M

while left < right:
	mid1 = (2*left + right)//3
	mid2 = (left + 2*right)//3
	m1=mid1//2
	m2=mid2//2
	curr1 = min(m1+N, M//2-m1)
	curr2 = min(m2+N, M//2-m2)
	if curr1 < curr2:
		left=mid1
	elif curr1 > curr2:
		right=mid2
	else:
		res=curr1
		break

res=(left if res == -1 else res)
print(res)	

Submission Info

Submission Time
Task C - Scc Puzzle
User ty70
Language Python (3.4.3)
Score 0
Code Size 368 Byte
Status WA
Exec Time 18 ms
Memory 3064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 8
WA × 1
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 18 ms 3064 KB
00_example_02.txt AC 18 ms 3064 KB
01.txt AC 18 ms 3064 KB
02.txt WA 18 ms 3060 KB
03.txt AC 18 ms 3064 KB
04.txt AC 18 ms 3060 KB
05.txt AC 18 ms 3064 KB
06.txt AC 18 ms 3064 KB
07.txt AC 18 ms 3064 KB