Submission #12640433


Source Code Expand

Copy
A,B,N = gets.split.map(&:to_i)
F = lambda{|x| A*x/B - x/B*A }
p [B,N].min.step(0,-[B/A,1].max).map(&F).max
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
A,B,N = gets.split.map(&:to_i)
F = lambda{|x| A*x/B - x/B*A }
p [B,N].min.step(0,-[B/A,1].max).map(&F).max

Submission Info

Submission Time
Task D - Floor Function
User ds14050
Language Ruby (2.7.1)
Score 400
Code Size 110 Byte
Status AC
Exec Time 232 ms
Memory 22012 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 10
Set Name Test Cases
Sample 01.txt, 02.txt
All 01.txt, 02.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt
Case Name Status Exec Time Memory
01.txt AC 50 ms 14196 KB
02.txt AC 49 ms 14184 KB
11.txt AC 232 ms 22012 KB
12.txt AC 113 ms 17324 KB
13.txt AC 51 ms 14232 KB
14.txt AC 71 ms 15400 KB
15.txt AC 53 ms 14264 KB
16.txt AC 51 ms 14220 KB
17.txt AC 53 ms 14060 KB
18.txt AC 49 ms 14164 KB


2025-04-20 (Sun)
19:19:36 +00:00