Skip to content

Commit

Permalink
4aa0347f-2081-47ef-a459-e9ee82768539 3
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Sep 21, 2021
1 parent e2c4d8c commit 8432524
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -3,8 +3,16 @@ use proconio::input;
fn main() {
input! {
n: usize,
mut a: [i64; n],
}
todo!();
let ans = n;
a.sort();
let mut prev = 0;
let mut product = 1_i64;
for a_i in a.iter().copied() {
product *= a_i - prev + 1;
product %= 1_000_000_007;
prev = a_i;
}
let ans = product;
println!("{}", ans);
}

0 comments on commit 8432524

Please sign in to comment.