結果
問題 | No.1593 Perfect Distance |
ユーザー |
![]() |
提出日時 | 2022-12-23 21:23:04 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 315 bytes |
コンパイル時間 | 13,218 ms |
コンパイル使用メモリ | 379,856 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 04:24:28 |
合計ジャッジ時間 | 10,805 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
fn main() {let mut n = String::new();std::io::stdin().read_line(&mut n).ok();let n: u64 = n.trim().parse().unwrap();let mut answer = 0;for x in 1..n {if ((n * n - x * x) as f64).sqrt().fract() < f64::EPSILON {answer += 1;}}println!("{answer}");}