# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
447511 | LucaIlie | Table Tennis (info1cup20_tabletennis) | C++17 | 95 ms | 5480 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <algorithm>
#include <map>
#define MAX_N 150000
#define MAX_K 400
int v[MAX_N + MAX_K], sume[(2 * MAX_K + 1) * (2 * MAX_K + 1)], ans[MAX_N];
int main() {
int n, k, m, suma, apMax, s, f, i, j;
scanf( "%d%d", &n, &k );
for ( i = 0; i < n + k; i++ )
scanf( "%d", &v[i] );
m = 0;
for ( i = 0; i < 2 * k + 1 && i < n + k; i++ ) {
for ( j = n + k - (2 * k + 1) > 0 ? n + k - (2 * k + 1) : 0; j < n + k; j++ ) {
if ( i != j ) {
sume[m] = v[i] + v[j];
m++;
}
}
}
std::sort( sume, sume + m );
suma = -1;
apMax = 0;
i = 0;
while ( i < m ) {
j = i + 1;
while ( j < m && sume[i] == sume[j] )
j++;
if ( j - i > apMax ) {
apMax = j - i;
suma = sume[i];
}
i = j;
}
s = 0;
f = n + k - 1;
i = 0;
while ( i < n / 2 ) {
if ( v[s] + v[f] == suma ) {
ans[i] = v[s];
ans[n - 1 - i] = v[f];
s++;
f--;
i++;
} else if ( v[s] + v[f] < suma )
s++;
else
f--;
}
i = 0;
while ( i < n )
i++;
if ( s - f <= 1 ) {
for ( i = 0; i < n; i++ )
printf( "%d ", ans[i] );
} else
printf( "%d ", 0 );
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |