Submission #945171

#TimeUsernameProblemLanguageResultExecution timeMemory
945171bngybongybrdFancy Fence (CEOI20_fancyfence)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int n; int w[100005]; int h[100005]; int ans = 0; int width = 0; int height; int mod = 1000000000 + 7; signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for(int i = 0; i < n; i++)cin >> h[i]; for(int i = 0; i < n; i++){ cin >> w[i]; width += w[i]; } if(width % 2 == 0){ // all rectangle for h=1 ans += (width+1)*(width/2); ans %= mod; } else { ans += (width*(width-1)/2)+width; ans %= mod; } height = h[0]; if(height % 2 == 0){ // all rectangle for h=1 ans *= (height+1)*(height/2); ans %= mod; } else { ans *= (height*(height-1)/2)+height; ans %= mod; } cout << ans; return 0; }
#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...