# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
261954 | Namnamseo | 전선 연결 (IOI17_wiring) | C++17 | 1 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pp=pair<int,int>;
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)((x).size()))
#define rep(i,n) for(int i=0; i<(n); ++i)
#define rrep(i,n) for(int i=1; i<=(n); ++i)
#define x first
#define y second
ll min_total_length(vector<int> vr, vector<int> vb) {
vector<pp> a;
for(int x:vr) a.eb(x, 0);
for(int x:vb) a.eb(x, 1);
sort(all(a));
int n = sz(a);
int rc = sz(vr), bc = sz(vb);
ll ans = 0;
rep(i, rc-1) ans += a[rc].x - a[i].x;
for(int i=rc+1; i<n; ++i) ans += a[i].x - a[rc-1].x;
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |