Skip to content

Commit 9c7543a

Browse files
committed
add abc419d.rs
1 parent 1e74e43 commit 9c7543a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/abc/abc419d.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
m:usize,
12+
mut s:Chars,
13+
t:Chars,
14+
lr:[(Usize1,Usize1);m]
15+
}
16+
17+
let mut memo = vec![(0,0);n];
18+
for (l,r) in lr {
19+
memo[l].0 += 1;
20+
memo[r].1 += 1;
21+
}
22+
23+
let mut temp = 0;
24+
for i in 0..n {
25+
temp += memo[i].0;
26+
if temp % 2 == 1 {
27+
s[i] = t[i];
28+
}
29+
temp -= memo[i].1;
30+
}
31+
32+
println!("{}", s.iter().collect::<String>());
33+
}

0 commit comments

Comments
 (0)