#include<cstdio>
#include<cassert>
#include<cstring>
#include<map>
#include<set>
#include<time.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<utility>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
using namespace std;
const long long MOD = 1000000007;
long long go(long long n) {
long long ret = 1;
for(long long i = 2; i <= n; ++i) { ret = (ret * i) % MOD; }
for(long long i = 2; i <= n-1; ++i) { ret = (ret * i) % MOD; }
return ret;
}
int main() {
long long n;
cin >> n;
long long ret = 0;
long long cursize = 0;
for(int i = 0; i < n; ++i) {
long long s;
cin >> s;
ret += cursize * s;
cursize += n;
}
cout << ret << endl;
cout << go(n) << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1672 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |