답안 #445030

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
445030 2021-07-16T09:48:23 Z osmanallazov Fancy Fence (CEOI20_fancyfence) C++14
0 / 100
2 ms 204 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    // SUBTASK 4---->SOLUTION
    ll n,z,s;
    ll res=0;
    ll mod=1e9+7;
    cin>>n;
    ll h[n];
    ll w[n];
    for(ll i=0;i<n;i++){
        cin>>h[i];
    }
    for(ll i=0;i<n;i++){
        cin>>w[i];
    }
    for(ll i=0;i<n;i++){
        ll mini=h[i];
        for(ll j=i-1;j>0;j--){
                mini=min(mini,h[j]);
            res+=((mini*(mini+1))/2);
        }
    }
    cout<<res;
}

Compilation message

fancyfence.cpp: In function 'int main()':
fancyfence.cpp:6:10: warning: unused variable 'z' [-Wunused-variable]
    6 |     ll n,z,s;
      |          ^
fancyfence.cpp:6:12: warning: unused variable 's' [-Wunused-variable]
    6 |     ll n,z,s;
      |            ^
fancyfence.cpp:8:8: warning: unused variable 'mod' [-Wunused-variable]
    8 |     ll mod=1e9+7;
      |        ^~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -