Skip to content

Commit 41210a5

Browse files
committed
add abc426c.rs
1 parent c6b07a3 commit 41210a5

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/abc/abc426c.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
q:usize,
12+
xy:[(usize,usize);q]
13+
}
14+
15+
let mut memo = vec![1;n];
16+
let mut o = 0;
17+
for (x,y) in xy {
18+
let mut count = 0;
19+
while o <= x-1 {
20+
memo[y-1] += memo[o];
21+
count += memo[o];
22+
memo[o] = 0;
23+
o += 1;
24+
}
25+
println!("{}", count);
26+
}
27+
}

0 commit comments

Comments
 (0)