首页 > 其他 > 详细

P1866 编号

时间:2021-08-16 22:49:10      阅读:12      评论:0      收藏:0      [点我收藏+]

#include <bits/stdc++.h>
using namespace std;

const int N=55;
const int p=1000000007;
int n;
int a[N];
long long ans=1;

int main()
{
    ios::sync_with_stdio(0);
    clock_t c1 = clock();
#ifdef LOCAL
    freopen("data.in","r",stdin);
    freopen("data.out","w",stdout);
#endif
    // ======================================================================
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=1,j=0;i<=n;i++,j++){
        ans=1ll*ans*(a[i]-j)%p;
    }
    cout<<ans;

    // ======================================================================
end:
    cerr << "Time Used:" << clock() - c1 << "ms" << endl;
    return 0;
}

P1866 编号

原文:https://www.cnblogs.com/syqwq/p/15150136.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!