ログインしてください。
提出 #30571429
ソースコード 拡げる
use proconio::{input, marker::Chars};
fn main() {
input! {
n: Chars,
};
let is_left = |c: char| -> bool {
let x = (c as u8 - b'0') as usize;
x != 0 && x <= 5
};
let mut sum = 500_usize;
let mut p = n[0];
for c in n.into_iter().skip(1) {
sum += if p == c {
301
} else if is_left(p) == is_left(c) {
210
} else {
100
};
p = c;
}
let ans = sum;
println!("{}", ans);
}
提出情報
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 7 / 7 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| example_00.txt | AC | 5 ms | 1992 KiB |
| example_01.txt | AC | 2 ms | 1920 KiB |
| example_02.txt | AC | 2 ms | 2000 KiB |
| hand_00.txt | AC | 6 ms | 2960 KiB |
| hand_01.txt | AC | 4 ms | 2912 KiB |
| hand_02.txt | AC | 5 ms | 2876 KiB |
| hand_03.txt | AC | 2 ms | 2044 KiB |
| hand_04.txt | AC | 1 ms | 2040 KiB |
| hand_05.txt | AC | 1 ms | 1912 KiB |
| hand_06.txt | AC | 2 ms | 2092 KiB |
| random_00.txt | AC | 10 ms | 3000 KiB |
| random_01.txt | AC | 8 ms | 2916 KiB |
| random_02.txt | AC | 5 ms | 3032 KiB |
| random_03.txt | AC | 6 ms | 2948 KiB |
| random_04.txt | AC | 6 ms | 2944 KiB |
| random_05.txt | AC | 6 ms | 2960 KiB |
| random_06.txt | AC | 5 ms | 2784 KiB |
| random_07.txt | AC | 5 ms | 2976 KiB |
| random_08.txt | AC | 3 ms | 2956 KiB |
| random_09.txt | AC | 6 ms | 2860 KiB |
| random_10.txt | AC | 5 ms | 2948 KiB |
| random_11.txt | AC | 6 ms | 2936 KiB |