Submission #944930

#TimeUsernameProblemLanguageResultExecution timeMemory
944930akqxolotlFancy Fence (CEOI20_fancyfence)C++17
12 / 100
314 ms604 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main(){ ios_base::sync_with_stdio(0);cin.tie(0); int n;cin>>n; int a[55][55]; for(int i=0;i<55;i++){ for(int j=0;j<55;j++){ a[i][j]=0; } } for(int i=0;i<n;i++){ int h;cin>>h; for(int j=0;j<h;j++){ a[i][j]=1; } } int ans=0; for(int i=0;i<55;i++){ for(int j=0;j<55;j++){ for(int x=0;x<55;x++){ if(x+i>=55)break; for(int y=0;y<55;y++){ if(y+j>=55)break; bool v=1; for(int xx=x;xx<=x+i;xx++){ for(int yy=y;yy<=y+j;yy++){ if(a[xx][yy]==0){ v=0;break; } } } if(v==1)ans++; } } } } cout<<ans; }
#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...