結果
| 問題 |
No.542 1円玉と5円玉
|
| コンテスト | |
| ユーザー |
tera_3939
|
| 提出日時 | 2017-07-14 23:30:22 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 524 bytes |
| コンパイル時間 | 12,333 ms |
| コンパイル使用メモリ | 401,184 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-07 23:34:38 |
| 合計ジャッジ時間 | 13,341 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 5 WA * 5 |
コンパイルメッセージ
warning: unnecessary parentheses around `if` condition
--> src/main.rs:18:15
|
18 | if(i + j != 0) {println!("{}", j + i * 5);}
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
18 - if(i + j != 0) {println!("{}", j + i * 5);}
18 + if i + j != 0 {println!("{}", j + i * 5);}
|
ソースコード
use std::io;
fn get_line() -> String {
let mut input = String::new();
io::stdin().read_line(&mut input).unwrap();
input
}
fn main() {
let input = get_line();
let hoge: Vec<usize> = input.trim()
.split(" ")
.map(|x| x.parse::<usize>().unwrap())
.collect();
let (a, b) = (hoge[0], hoge[1]);
for i in 0..b+1 {
for j in 0..a+1 {
if(i + j != 0) {println!("{}", j + i * 5);}
}
}
}
tera_3939