結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
cra77756176
|
| 提出日時 | 2022-12-07 19:34:52 |
| 言語 | Rust (1.99.0 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 1,000 ms |
| + 863µs | |
| コード長 | 520 bytes |
| 記録 | |
| コンパイル時間 | 1,673 ms |
| コンパイル使用メモリ | 188,464 KB |
| 実行使用メモリ | 7,852 KB |
| 最終ジャッジ日時 | 2026-10-11 08:28:22 |
| 合計ジャッジ時間 | 1,982 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
fn main() {
let mut input = String::new();
std::io::Read::read_to_string(&mut std::io::stdin(), &mut input).ok();
let input: Vec<i64> = input
.split_whitespace()
.skip(1)
.map(|n| n.parse().unwrap())
.collect();
let mut n = input[1] - input[0];
if n <= 0 {
n = -1;
} else {
for xy in input[2..].chunks(2) {
if xy[1] - xy[0] != n {
n = -1;
break;
}
}
}
println!("{}", n);
}
cra77756176