Submission #870436

#TimeUsernameProblemLanguageResultExecution timeMemory
870436gutzzyFancy Fence (CEOI20_fancyfence)C++14
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; int main(){ int n; cin >> n; vector<long long> h(n); vector<long long> w(n); long long m=0; for(int i=0;i<n;i++) cin >> h[i]; for(int i=0;i<n;i++){ cin >> w[i]; m += w[i]; } long long p = (h[0]*(h[0]+1)/2)%mod; long long q = (m*(m+1)/2)%mod; cout << (p*q)%mod << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...