Submission #477496

#TimeUsernameProblemLanguageResultExecution timeMemory
477496niloyrootFancy Fence (CEOI20_fancyfence)C++14
15 / 100
31 ms2348 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; ll nc2(ll a){ ll b=a+1; if(a%2==0){ a/=2; } else { b/=2; } return (a*b)%mod; } 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=nc2(h); ans*=nc2(sum); 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...