結果
| 問題 |
No.481 1から10
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-14 17:05:20 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 645 bytes |
| コンパイル時間 | 15,583 ms |
| コンパイル使用メモリ | 380,264 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 04:46:27 |
| 合計ジャッジ時間 | 14,041 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 |
ソースコード
use std::io::{self, Read};
fn read_stdin() -> Vec<String> {
let mut buffer = String::new();
io::stdin().read_to_string(&mut buffer).ok();
buffer.trim().split('\n').map(|s| s.to_string()).collect()
}
fn main() {
let input: Vec<usize> = read_stdin()[0].split(' ').map(|s| s.parse::<usize>().unwrap()).collect();
let mut iter = input.iter();
let i = iter.next();
if i == Some(&2) {
println!("{}", 1);
return
}
for (x, y) in input.iter().zip(iter.collect::<Vec<&usize>>()) {
if y - x != 1 {
println!("{}", y - 1);
return
}
}
println!("{}", 10);
}