Submission #477495

#TimeUsernameProblemLanguageResultExecution timeMemory
477495niloyrootFancy Fence (CEOI20_fancyfence)C++14
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; #define forp(i,a,b) for(ll i=a;i<=b;i++) #define newl '\n' const ll mod=1000000007; void solve(){ ll n; cin>>n; ll sum=0,h,c; forp(i,1,n){cin>>h;} forp(i,1,n){cin>>c; sum+=c;} ll ans=(h*(h+1)*sum*(sum+1))/4; ans%=mod; cout<<ans<<newl; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); solve(); }
#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...