結果
問題 | No.1218 Something Like a Theorem |
ユーザー | Konton7 |
提出日時 | 2020-09-04 21:57:35 |
言語 | Rust (1.77.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,159 bytes |
コンパイル時間 | 11,605 ms |
コンパイル使用メモリ | 385,368 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-05-04 22:15:51 |
合計ジャッジ時間 | 12,532 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 1 ms
5,376 KB |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | AC | 1 ms
5,376 KB |
testcase_17 | AC | 1 ms
5,376 KB |
コンパイルメッセージ
warning: fields `mark`, `y`, and `x` are never read --> src/main.rs:59:5 | 58 | struct Piece { | ----- fields in this struct 59 | mark: char, | ^^^^ 60 | y: i32, | ^ 61 | x: i32, | ^ | = note: `Piece` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis = note: `#[warn(dead_code)]` on by default
ソースコード
#[allow(unused_imports)] use std::cmp; #[allow(unused_imports)] use std::collections::BTreeSet; #[allow(unused_imports)] use std::collections::HashMap; #[allow(unused_imports)] use std::collections::HashSet; use std::fmt::Display; use std::fs::File; use std::io::Read; #[allow(unused_imports)] use std::mem; #[allow(dead_code)] fn pow_speedy_with_mod(mut p: i64, mut q: i64, m: i64) -> i64 { p %= m; let mut r = p; let mut ret: i64 = 1; while q > 0 { ret *= if q % 2 == 1 { r } else { 1 }; r *= r; r %= m; q /= 2; ret %= m; } return ret; } #[allow(dead_code)] fn comb(n: usize, k: usize, m: i64, frac: &[i64], frac_inv: &[i64]) -> i64 { let mut ret = 1i64; if n < k { return 0; } ret *= frac[n] * frac_inv[n - k]; ret %= m; ret *= frac_inv[k]; ret %= m; ret } #[allow(dead_code)] fn show1dvec<T: Display>(v: &Vec<T>) { let n = v.len(); for i in 0..n - 1 { print!("{} ", v[i]); } println!("{} ", v[n - 1]); } #[allow(dead_code)] fn check(i: usize, j: usize, h: usize, w: usize) -> bool { i < h && j < w } #[derive(Debug)] struct Piece { mark: char, y: i32, x: i32, } fn main() { let inputstatus = 1001; let mut buf = String::new(); let filename = "inputrust.txt"; if inputstatus == 0 { let mut f = File::open(filename).expect("file not found"); f.read_to_string(&mut buf) .expect("something went wrong reading the file"); } else { std::io::stdin().read_to_string(&mut buf).unwrap(); } let mut iter = buf.split_whitespace(); let n: usize = iter.next().unwrap().parse().unwrap(); let z: usize = iter.next().unwrap().parse().unwrap(); if n >= 3 { println!("No"); return; } for i in 1..1001 { for j in 1..1001 { let r = i * i + j * j == z * z; if r { println!("Yes"); return; } } } println!("No"); // let n = iter.next().unwrap().parse().unwrap(); // println!("{}", n); // println!("{:?}", cum_num); }