Submission #71126651
Source Code Expand
use std::io::{Read, Write};
fn main() {
let out = std::io::stdout();
let mut out = std::io::BufWriter::new(out.lock());
let mut input = String::new();
std::io::stdin().read_to_string(&mut input).unwrap();
let mut iter = input.split_ascii_whitespace();
let x: i32 =iter.next().unwrap().parse().unwrap();
let y: i32 =iter.next().unwrap().parse().unwrap();
let z: i32 =iter.next().unwrap().parse().unwrap();
// x+i=(y+i)*z の解 i が正の整数
if ((x-y*z) % (z-1))==0 && (x-y*z)/(z-1) >= 0 {
writeln!(out, "Yes").unwrap();
} else {
writeln!(out, "No").unwrap();
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Happy Birthday! 4 |
| User | akatsuki7c8 |
| Language | Rust (rustc 1.89.0) |
| Score | 100 |
| Code Size | 657 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 2064 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_00.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, 01_random_11.txt, 01_random_12.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 1812 KiB |
| 00_sample_01.txt | AC | 0 ms | 1936 KiB |
| 00_sample_02.txt | AC | 0 ms | 2064 KiB |
| 00_sample_03.txt | AC | 0 ms | 1956 KiB |
| 01_random_00.txt | AC | 1 ms | 1796 KiB |
| 01_random_01.txt | AC | 0 ms | 1812 KiB |
| 01_random_02.txt | AC | 0 ms | 1848 KiB |
| 01_random_03.txt | AC | 0 ms | 1772 KiB |
| 01_random_04.txt | AC | 0 ms | 1936 KiB |
| 01_random_05.txt | AC | 0 ms | 1868 KiB |
| 01_random_06.txt | AC | 0 ms | 1964 KiB |
| 01_random_07.txt | AC | 1 ms | 1988 KiB |
| 01_random_08.txt | AC | 0 ms | 1900 KiB |
| 01_random_09.txt | AC | 0 ms | 1812 KiB |
| 01_random_10.txt | AC | 0 ms | 2064 KiB |
| 01_random_11.txt | AC | 0 ms | 2012 KiB |
| 01_random_12.txt | AC | 0 ms | 2008 KiB |