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
int n, w, h;
const int mod = (int)1e9+7;
int qexp(int a, int b) {
a%=mod;
int res=1;
while(b){
if(b&1)res = res*a%mod;
a = a*a%mod;
b>>=1;
}
return res;
}
int C(int n, int k) {
int x = 1, y = 1;
for(int i=0; i<k-1; ++i){
y*=n-i;
x*=k-i;
y%=mod;
x%=mod;
}
return (y*qexp(x,mod-2))% mod;
}
int tri(int intelligence, int yeet){
return (intelligence*(intelligence-1))*(yeet*(yeet-1))/4%mod;
}
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>n;
for(int i=0; i<n; ++i){
cin>>h;
}
for(int i=0; i<n; ++i){
int l;
cin>>l;
w+=l;
}
cout<<tri(w, h);
return 0;
}
# | 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... |