Submission #445011

#TimeUsernameProblemLanguageResultExecution timeMemory
445011osmanallazovFancy Fence (CEOI20_fancyfence)C++14
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; int main(){ // SUBTASK 4---->SOLUTION ll n; ll mod=1e9+7; cin>>n; ll h[n]; ll w[n]; for(ll i=0;i<n;i++){ cin>>h[i]; } ll he=h[0]; ll we=0; for(ll i=0;i<n;i++){ cin>>w[i]; we=(we+w[i])%mod; } ll q=he%mod; ll a=(he+1)%mod; ll e=((q*a)%mod)/2; ll b=we%mod; ll c=(we+1)%mod; ll d=((b*c)%mod)/2; ll res=(d*e)%mod; cout<<res; }
#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...