# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9604 | jaehadad | Uniting (kriii2_U) | C++14 | 0 ms | 1672 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |