Submission #898363

#TimeUsernameProblemLanguageResultExecution timeMemory
898363LCJLYFancy Fence (CEOI20_fancyfence)C++14
15 / 100
18 ms3932 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ld long double #define show(x,y) //cout << y << " " << #x << endl; #define show2(x,y,i,j) //cout << y << " " << #x << " " << j << " " << #i << endl; #define show3(x,y,i,j,p,q) //cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl; #define show4(x,y) for(auto it:x) cout << it << " "; cout << #y << endl; typedef pair<int,int>pii; typedef pair<pii,pii>pi2; int mod=1e9+7; int f(int a, int b){ a%=mod; b%=mod; return (a*b)%mod; } void solve(){ int n; cin >> n; pii arr[n]; int w=0; int h=0; for(int x=0;x<n;x++){ cin >> arr[x].first; h=max(h,arr[x].first); } for(int x=0;x<n;x++){ cin >> arr[x].second; w+=arr[x].second; } int hold=f(w,w+1); hold=f(hold,h); hold=f(hold,h+1); hold=f(hold,250000002); cout << hold; } int32_t main(){ ios::sync_with_stdio(0); cin.tie(0); //freopen("redistricting.in", "r", stdin); //freopen("redistricting.out", "w", stdout); int t=1; //cin >> t; while(t--){ 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...