Submission #76929683


Source Code Expand

a, b = map(int, input().split())

x = a // b

y = x + 1

c1 = b * x
c2 = b * y

if abs(c1 - a) > abs(c2 - a):
  print(y)
else:
  print(x)

Submission Info

Submission Time
Task A - Approximation
User griez
Language Python (PyPy 3.11-v7.3.20)
Score 150
Code Size 149 Byte
Status AC
Exec Time 58 ms
Memory 79896 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 150 / 150
Status
AC × 3
AC × 13
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 57 ms 79448 KiB
00_sample_01.txt AC 57 ms 79488 KiB
00_sample_02.txt AC 57 ms 79584 KiB
01_handmade_03.txt AC 57 ms 79896 KiB
01_handmade_04.txt AC 57 ms 79428 KiB
01_handmade_05.txt AC 57 ms 79584 KiB
01_handmade_06.txt AC 57 ms 79756 KiB
02_random_07.txt AC 57 ms 79688 KiB
02_random_08.txt AC 58 ms 79676 KiB
02_random_09.txt AC 57 ms 79736 KiB
02_random_10.txt AC 58 ms 79728 KiB
02_random_11.txt AC 57 ms 79760 KiB
02_random_12.txt AC 56 ms 79436 KiB