結果
問題 | No.1593 Perfect Distance |
ユーザー |
|
提出日時 | 2024-06-25 13:51:49 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 249 bytes |
コンパイル時間 | 15,745 ms |
コンパイル使用メモリ | 378,564 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 13:52:07 |
合計ジャッジ時間 | 16,884 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n: u64 = s.trim().parse().unwrap(); println!( "{}", (1..n).fold(0, |c, x| { c + (((n * n - x * x) as f64).sqrt().fract() < f64::EPSILON) as u64 }) ) }