제출 #46481

#제출 시각아이디문제언어결과실행 시간메모리
464811KhanBuilding Bridges (CEOI17_building)C++17
0 / 100
66 ms1128 KiB
#include <bits/stdc++.h>

using namespace std;

#define Tupizm ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);

#define ONE exit(0);
#define nl "\n"

#define fly return

#define ff first
#define ss second

#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()

#define pb push_back
#define ppb pop_back

typedef long long ll;
typedef double db;

const int N = 1e5 + 5;
const int M = 1e9 + 7;

int n, h[N], w[N];
ll sum;
int main(){
      
    cin >> n;
    for(int i = 1; i <= n; ++i){
        cin >> h[i];
    }
    for(int i = 1; i <= n; ++i){
        cin >> w[i];
        sum += w[i];
    }
    sum += (h[n] - h[1]) * (h[n] - h[1]);
    cout << sum;
    ONE
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...