Submission #900668

#TimeUsernameProblemLanguageResultExecution timeMemory
9006683laaFancy Fence (CEOI20_fancyfence)C++14
15 / 100
57 ms3924 KiB
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) #include <bits/stdc++.h> #include <unordered_map> #define endl '\n' #define mid ((l+r)/2) #define F first #define S second #define pb push_back #define yes void (cout<<"YES"<<endl) #define no void (cout<<"NO"<<endl) #define ump unordered_map <ll,ll> #define sp " " #define vll vector<ll> #define vint vector<int> #define pll pair<ll,ll> typedef long long ll; using namespace std; const ll inf=1e18+9; const ll M=1e9+7; ll n; ll h[100009]; ll w[100009]; int main(){ cin>>n; ll H=0,W=0; for(ll i=0 ; i<n ; i++){ cin>>h[i]; H=h[i]; } for(ll i=0 ; i<n ; i++){ cin>>w[i]; W+=w[i]; W%=M; } H%=M; W=((W*(W+1))/2)%M; H=((H*(H+1))/2)%M; cout<<(W*H)%M<<endl; }
#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...