Submission #1158893

#TimeUsernameProblemLanguageResultExecution timeMemory
1158893PagodePaiva전선 연결 (IOI17_wiring)C++20
Compilation error
0 ms0 KiB
#include "wiring.h"
#include<bits/stdc++.h>

using namespace std;

long long min_total_length(std::vector<int> r, std::vector<int> b) {
    long long ans = 0;
    reverse(r.begin(), r.end())
    while(r.size() > b.size()){
        ans += abs(r.back()-b[0]);
        r.pop_back();
    }
    while(b.size() > r.size()){
        ans += abs(b.back()-r[0]);
        b.pop_back();
    }
    for(int i = 0;i < min((int)r.size(), (int)b.size());i++){
        ans += b[i]-r[i];
    }
    return ans;
}

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:8:32: error: expected ';' before 'while'
    8 |     reverse(r.begin(), r.end())
      |                                ^
      |                                ;
    9 |     while(r.size() > b.size()){
      |     ~~~~~