結果
| 問題 |
No.2721 "Don't say N" Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-12 21:55:20 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,226 bytes |
| コンパイル時間 | 11,938 ms |
| コンパイル使用メモリ | 379,008 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-10-02 23:15:57 |
| 合計ジャッジ時間 | 12,801 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
use proconio::{
fastout, input,
marker::{Bytes, Chars, Usize1},
};
macro_rules! debug {
( $($val:expr),* $(,)* ) => {{
#[cfg(debug_assertions)]
eprintln!( concat!($(stringify!($val), " = {:?}, "),*), $($val),* );
}};
}
macro_rules! debug2D {
( $array:expr ) => {{
#![cfg(debug_assertions)]
eprintln!("{}: ", stringify!($array));
for row in &$array {
eprintln!("{:?}", row);
}
}};
}
// constant
const MOD1: usize = 1_000_000_007;
const MOD9: usize = 998_244_353;
const INF: usize = 1001001001001001001;
fn main() {
input! {
T: usize,
}
for _ in 0..T {
solve();
}
}
fn solve() {
input! {
N: usize,
}
// Nの正の約数の個数をカウント
let mut cnt = 0;
let mut i = 1;
while i * i <= N {
if i * i == N {
cnt += 1;
} else if N % i == 0 {
cnt += 2;
}
i += 1;
}
// 偶奇で場合分け
if cnt % 2 == 0 {
println!("K");
} else {
println!("P");
}
}