| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 100572 | Extazy | Palembang Bridges (APIO15_bridge) | C++17 | 53 ms | 3452 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int N = 200007;
int n, k, arr[N], sz;
long long ans, offset;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int i, x, y;
char tmp1[4], tmp2[4];
scanf("%d %d", &k, &n);
for(i=1;i<=n;i++) {
scanf("%s %d %s %d", tmp1, &x, tmp2, &y);
if(tmp1[0]==tmp2[0]) offset += abs(x - y);
else {
arr[++sz] = x;
arr[++sz] = y;
++offset;
}
}
sort(arr + 1, arr + 1 + sz);
if(k==1) {
ans = offset;
for(i=1;i<=sz;i++) {
ans += abs(arr[i] - arr[(sz + 1) / 2]);
}
}
else {
}
printf("%lld\n", ans);
return 0;
}
컴파일 시 표준 에러 (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... | ||||
