Skip to content

Commit 8de9544

Browse files
committed
add abc370b.rs
1 parent 3e52bf0 commit 8de9544

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/abc/abc370b.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/** THIS IS AN OUTPUT FILE. NOT EDIT THIS FILE DIRECTLY. **/
2+
use proconio::input;
3+
use proconio::marker::*;
4+
use std::marker::PhantomData;
5+
use std::cmp::*;
6+
use std::collections::*;
7+
8+
fn main() {
9+
input! {
10+
n:usize
11+
}
12+
13+
let mut arr = vec![];
14+
for i in 0..n {
15+
input! {
16+
a: [Usize1;i+1]
17+
}
18+
arr.push(a);
19+
}
20+
21+
let mut now = 0;
22+
for i in 0..n {
23+
let (ri, ci) = if now >= i {
24+
(now, i)
25+
} else {
26+
(i, now)
27+
};
28+
now = arr[ri][ci];
29+
}
30+
31+
println!("{}", now+1);
32+
}

0 commit comments

Comments
 (0)