Created
July 12, 2021 02:51
-
-
Save uchidama/c74156f5673fae4e8285807c08c8297d to your computer and use it in GitHub Desktop.
AtCoder Beginner Contest 209 [ C - Not Equal ] https://atcoder.jp/contests/abc209/tasks/abc209_c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc209/tasks/abc209_c | |
''' | |
import sys | |
sys.setrecursionlimit(10 ** 6) # 再帰上限の引き上げ | |
input = sys.stdin.readline | |
INF = 2 ** 63 - 1 | |
N = int(input()) | |
C = list(map(int, input().split())) | |
C.sort() | |
ans = 1 | |
for i,j in enumerate(C): | |
ans = ans * (j - i) % (10**9+7) | |
# 最後にまとめて余り計算はTLE | |
#ans *= (j - i) | |
print(ans) | |
# 最後にまとめて余り計算はTLE | |
#print(ans%(10**9+7)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment