結果

問題 No.2515 Similar Triangles
ユーザー TakaTaka
提出日時 2023-10-28 03:16:59
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 697 ms
コンパイル使用メモリ 169,332 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-28 03:17:05
合計ジャッジ時間 1,503 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 0 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `x1`
  --> Main.rs:12:9
   |
12 |     let x1 = values[0];
   |         ^^ help: if this is intentional, prefix it with an underscore: `_x1`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `x2`
  --> Main.rs:14:9
   |
14 |     let x2 = values[2];
   |         ^^ help: if this is intentional, prefix it with an underscore: `_x2`

warning: unused variable: `x3`
  --> Main.rs:16:9
   |
16 |     let x3 = values[4];
   |         ^^ help: if this is intentional, prefix it with an underscore: `_x3`

warning: variable does not need to be mutable
  --> Main.rs:18:9
   |
18 |     let mut ans: &str;
   |         ----^^^
   |         |
   |         help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

warning: 4 warnings emitted

ソースコード

diff #

use std::io;

fn main(){

    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let values: Vec<i32> = input
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect();

    let x1 = values[0];
    let y1 = values[1];
    let x2 = values[2];
    let y2 = values[3];
    let x3 = values[4];

    let mut ans: &str;

    if y1==y2 {
        ans = "Yes";
    }

    else{
        ans = "No";
    }

    println!("{}", ans);
}
0