Submission #445037

# Submission time Handle Problem Language Result Execution time Memory
445037 2021-07-16T09:55:23 Z osmanallazov Fancy Fence (CEOI20_fancyfence) C++14
12 / 100
2 ms 204 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    // SUBTASK 2---->SOLUTION
    int n,z,s;
    int res=0;
    ll mod=1e9+7;
    cin>>n;
    int h[n+1];
    int w[n+1];
    for(int i=1;i<=n;i++){
        cin>>h[i];
    }
    for(int i=1;i<=n;i++){
        cin>>w[i];
    }
    for(int i=1;i<=n;i++){
        int mini=h[i];
        for(int j=i;j>=1;j--){
                mini=min(mini,h[j]);
            res+=((mini*(mini+1))/2);
        }
    }
    cout<<res;
}

Compilation message

fancyfence.cpp: In function 'int main()':
fancyfence.cpp:6:11: warning: unused variable 'z' [-Wunused-variable]
    6 |     int n,z,s;
      |           ^
fancyfence.cpp:6:13: warning: unused variable 's' [-Wunused-variable]
    6 |     int n,z,s;
      |             ^
fancyfence.cpp:8:8: warning: unused variable 'mod' [-Wunused-variable]
    8 |     ll mod=1e9+7;
      |        ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -