Submission #32866738
Source Code Expand
Copy
use proconio::input;fn main() {input! {a: usize,b: usize,n: usize,};let f = |x: usize| -> usize { (a * x) / b - a * (x / b) };let c = n / b;let r = (c * b).saturating_sub(1);let ans = f(r).max(f(n));println!("{}", ans);}
use proconio::input; fn main() { input! { a: usize, b: usize, n: usize, }; let f = |x: usize| -> usize { (a * x) / b - a * (x / b) }; let c = n / b; let r = (c * b).saturating_sub(1); let ans = f(r).max(f(n)); println!("{}", ans); }
Submission Info
Submission Time | |
---|---|
Task | D - Floor Function |
User | bouzuya |
Language | Rust (1.42.0) |
Score | 400 |
Code Size | 286 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 2148 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
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 | 6 ms | 2000 KB |
02.txt | AC | 1 ms | 2100 KB |
11.txt | AC | 1 ms | 1984 KB |
12.txt | AC | 2 ms | 2148 KB |
13.txt | AC | 1 ms | 2012 KB |
14.txt | AC | 1 ms | 2112 KB |
15.txt | AC | 1 ms | 2096 KB |
16.txt | AC | 1 ms | 1992 KB |
17.txt | AC | 1 ms | 2088 KB |
18.txt | AC | 2 ms | 2084 KB |