結果

問題 No.2379 Burnside's Theorem
ユーザー
提出日時 2024-07-18 16:26:43
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 14,070 ms
コンパイル使用メモリ 377,352 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-18 16:26:59
合計ジャッジ時間 15,869 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::collections::HashSet;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).ok();
	let mut n: u64 = s.trim().parse().unwrap();
	let mut h = HashSet::new();
	for i in 2.. {
		if i * i > n {
			if n > 1 {
				h.insert(n);
			}
			break;
		}
		while n % i == 0 {
			h.insert(i);
			n /= i
		}
	}
	println!("{}", if h.len() < 3 { "Yes" } else { "No" })
}
0