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 <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int N,temp1,temp2,zong = 0;
cin >> N;
for (int a = 1; a <= N; a++)
{
cin >> temp1;
}
for (int a = 1; a <= N; a++)
{
cin >> temp2;
zong += temp2;
}
int ans = (zong + 1) * zong / 2;
//cout << "before : " << ans << "\n";
//cout << temp1 << " and " << (temp1 * (temp1 + 1)/2) << "\n";
ans *= (temp1 * (temp1 + 1)/2);
cout << (ans % 1000000007);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |