Submission #477493

#TimeUsernameProblemLanguageResultExecution timeMemory
477493niloyrootFancy 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; sum%=mod;} ll ans=(h*(h+1))/2; ans%=mod; ans*=((sum*(sum+1))/2); 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...