# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
9582 |
2014-09-28T07:25:34 Z |
moonrabbit2 |
Uniting (kriii2_U) |
C++ |
|
0 ms |
1476 KB |
#include <cstdio>
#include <algorithm>
#define N 1000000007
int a[100005],n;
int sum=1;
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
std::sort(a,a+n);
for(int i=0;i<n-1;i++){
sum=(sum%N*(i+1)*a[i]%N)%N;
}
sum=(sum%N*a[n-1]%N)%N;
printf("%d\n%d",sum,sum*2);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1476 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |