Submission #851255

#TimeUsernameProblemLanguageResultExecution timeMemory
851255Jawad_Akbar_JJFancy Fence (CEOI20_fancyfence)C++14
12 / 100
1 ms604 KiB
#include <bits/stdc++.h> using namespace std; int r[55][55]; int w[55]; int h[88]; int main(){ int n; cin>>n; for (int i=1;i<=n;i++) cin>>h[i]; for (int i=1;i<=n;i++) cin>>w[i]; int ans = 0; for (int i=n;i>=1;i--){ for (int j=1;j<=h[i];j++){ r[i][j] = r[i+1][j] + 1; ans += r[i][j]*j; // cout<<"At "<<i<<" "<<j<<" added "<<r[i][j]*j<<endl; } } cout<<ans<<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...