結果

問題 No.2811 Calculation Within Sequence
ユーザー ⁣
提出日時 2024-08-13 13:42:58
言語 Rust
(1.77.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 12,967 ms
コンパイル使用メモリ 385,284 KB
実行使用メモリ 8,304 KB
最終ジャッジ日時 2024-08-13 13:43:16
合計ジャッジ時間 17,136 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,816 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 26 ms
6,948 KB
testcase_04 AC 23 ms
6,944 KB
testcase_05 AC 23 ms
6,968 KB
testcase_06 AC 24 ms
6,944 KB
testcase_07 AC 22 ms
6,944 KB
testcase_08 AC 22 ms
6,944 KB
testcase_09 AC 22 ms
7,692 KB
testcase_10 AC 23 ms
6,944 KB
testcase_11 AC 21 ms
6,940 KB
testcase_12 AC 25 ms
6,944 KB
testcase_13 AC 27 ms
8,088 KB
testcase_14 AC 25 ms
7,960 KB
testcase_15 AC 25 ms
6,940 KB
testcase_16 AC 24 ms
7,248 KB
testcase_17 AC 26 ms
7,320 KB
testcase_18 AC 25 ms
6,944 KB
testcase_19 AC 26 ms
7,020 KB
testcase_20 AC 26 ms
8,216 KB
testcase_21 AC 23 ms
7,828 KB
testcase_22 AC 24 ms
8,304 KB
testcase_23 AC 26 ms
7,196 KB
testcase_24 AC 14 ms
6,944 KB
testcase_25 AC 6 ms
6,944 KB
testcase_26 AC 6 ms
6,940 KB
testcase_27 AC 16 ms
6,940 KB
testcase_28 AC 3 ms
6,940 KB
testcase_29 AC 12 ms
6,940 KB
testcase_30 AC 12 ms
6,940 KB
testcase_31 AC 12 ms
6,940 KB
testcase_32 AC 4 ms
6,944 KB
testcase_33 AC 11 ms
6,944 KB
testcase_34 AC 14 ms
6,944 KB
testcase_35 AC 7 ms
6,940 KB
testcase_36 AC 11 ms
6,940 KB
testcase_37 AC 9 ms
6,944 KB
testcase_38 AC 9 ms
6,944 KB
testcase_39 AC 9 ms
6,944 KB
testcase_40 AC 12 ms
6,944 KB
testcase_41 AC 15 ms
6,944 KB
testcase_42 AC 7 ms
6,944 KB
testcase_43 AC 10 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn g() -> Vec<u64> {
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).ok();
	s.split_whitespace().flat_map(str::parse).collect()
}
fn d(a: u64, b: u64) -> u64 {
	if a < 1 {
		return b;
	}
	d(b % a, a)
}
fn main() {
	g();
	let (t, s) = (g(), g());
	let t = t.iter().cloned().reduce(d).unwrap();
	let s = s.iter().all(|s| s % t == 0);
	println!("{}", if s { "Yes" } else { "No" });
}
0