結果
| 問題 |
No.2515 Similar Triangles
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-28 03:16:59 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 480 bytes |
| コンパイル時間 | 17,024 ms |
| コンパイル使用メモリ | 390,564 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-25 15:59:28 |
| 合計ジャッジ時間 | 18,105 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
コンパイルメッセージ
warning: unused variable: `x1` --> src/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` --> src/main.rs:14:9 | 14 | let x2 = values[2]; | ^^ help: if this is intentional, prefix it with an underscore: `_x2` warning: unused variable: `x3` --> src/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 --> src/main.rs:18:9 | 18 | let mut ans: &str; | ----^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
ソースコード
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);
}