이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define moddy 1000000007
signed main()
{
int N,temp1,temp2,zong = 0;
cin >> N;
for (int a = 1; a <= N; a++)
{
cin >> temp1;
}
temp1 = temp1 % moddy;
for (int a = 1; a <= N; a++)
{
cin >> temp2;
zong += temp2;
zong %= moddy;
}
int ans = (zong + 1) * zong / 2;
ans %= moddy;
//cout << "before : " << ans << "\n";
//cout << temp1 << " and " << (temp1 * (temp1 + 1)/2) << "\n";
int temp3 = (temp1 * (temp1 + 1)/2);
temp3 %= moddy;
ans = ans * temp3;
cout << (ans % moddy);
}
# | 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... |