Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
38339 22级廖思学 【S】T3 C++ 通过 100 78 MS 3392 KB 607 2025-10-03 14:10:46

Tests(10/10):


#include<bits/stdc++.h> using namespace std; #define int long long const int N=2e5+10,M=1e9+7; int n,b[N],c[N],cnt[N],a[N],ori[N],ans=1,pw[N]; int qpow(int a,int b){ int ans=1; while(b>0){ if(b&1)ans=ans*a%M; a=a*a%M;b>>=1; }return ans; } signed main(){ pw[0]=1;for(int i=1;i<=N-10;i++)pw[i]=pw[i-1]*2%(M-1); scanf("%lld",&n); for(int i=1;i<=n;i++)scanf("%lld",&a[i]); sort(a+1,a+n+1); for(int i=1;i<=n;i++){ ans=ans*qpow(a[i],pw[i-1]+pw[n-i])%M; } printf("%lld\n",ans); fclose(stdin);fclose(stdout); return 0; }


测评信息: