Skip to content

Commit c04461a

Browse files
committed
Solve C in code-festival-2015-qualb
1 parent bef65bd commit c04461a

File tree

1 file changed

+17
-0
lines changed
  • atcoder/rust/code-festival-2015-qualb/src/bin

1 file changed

+17
-0
lines changed

atcoder/rust/code-festival-2015-qualb/src/bin/c.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ use superslice::*;
1414

1515
fn main() {
1616
input! {
17+
n: usize, m: usize,
18+
mut a: [usize; n],
19+
mut b: [usize; m],
20+
}
21+
22+
a.sort();
23+
b.sort();
1724

25+
if n < m {
26+
return println!("NO");
1827
}
28+
29+
for (i, &people_num) in b.iter().rev().enumerate() {
30+
if a[n-1-i] < people_num {
31+
return println!("NO");
32+
}
33+
}
34+
35+
println!("YES");
1936
}

0 commit comments

Comments
 (0)