Submission #33773060


Source Code Expand

N,A,B = gets.split.map(&:to_i)
if N<A
	p 0
elsif A<=B
	p N-A+1
else
	# A..N のうち %A<B となるもの
	p B*(N/A-1)+[N%A,B-1].min+1
end

Submission Info

Submission Time
Task B - AB Game
User ds14050
Language Ruby (2.7.1)
Score 500
Code Size 149 Byte
Status AC
Exec Time 59 ms
Memory 14232 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 22
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt, 02_handmade_07.txt, 02_handmade_08.txt, 02_handmade_09.txt, 02_handmade_10.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 56 ms 14032 KiB
00_sample_02.txt AC 56 ms 14020 KiB
01_random_01.txt AC 59 ms 14028 KiB
01_random_02.txt AC 57 ms 14012 KiB
01_random_03.txt AC 57 ms 14032 KiB
01_random_04.txt AC 57 ms 14192 KiB
01_random_05.txt AC 56 ms 14176 KiB
01_random_06.txt AC 57 ms 14044 KiB
01_random_07.txt AC 55 ms 14152 KiB
01_random_08.txt AC 55 ms 14040 KiB
01_random_09.txt AC 55 ms 14144 KiB
01_random_10.txt AC 57 ms 14024 KiB
02_handmade_01.txt AC 57 ms 14228 KiB
02_handmade_02.txt AC 56 ms 14148 KiB
02_handmade_03.txt AC 59 ms 14056 KiB
02_handmade_04.txt AC 55 ms 14112 KiB
02_handmade_05.txt AC 57 ms 14232 KiB
02_handmade_06.txt AC 57 ms 14136 KiB
02_handmade_07.txt AC 59 ms 14152 KiB
02_handmade_08.txt AC 57 ms 14072 KiB
02_handmade_09.txt AC 54 ms 14216 KiB
02_handmade_10.txt AC 58 ms 14192 KiB