# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
447547 | 2021-07-26T17:40:02 Z | LucaIlie | Table Tennis (info1cup20_tabletennis) | C++17 | 80 ms | 3300 KB |
#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, elim, s, f, i, j; scanf( "%d%d", &n, &k ); for ( i = 0; i < n + k; i++ ) scanf( "%d", &v[i] ); for ( i = 0; i < k + 1; i++ ) { for ( j = n - 1 + i; j < n + k; j++ ) { elim = j - i + 1 - n; s = i; f = j; suma = v[s] + v[f]; ans[0] = v[s]; ans[n - 1] = v[f]; s++; f--; m = 1; while ( s < f && elim >= 0 ) { if ( v[s] + v[f] == suma ) { ans[m] = v[s]; ans[n - 1 - m] = v[f]; m++; s++; f--; } else if ( v[s] + v[f] < suma ) { s++; elim--; } else { f--; elim--; } } if ( m == n / 2 ) break; } if ( j < n + k ) break; } for ( i = 0; i < n; i++ ) printf( "%d ", ans[i] ); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 728 KB | Output is correct |
2 | Correct | 41 ms | 3188 KB | Output is correct |
3 | Correct | 41 ms | 3140 KB | Output is correct |
4 | Correct | 40 ms | 3140 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 40 ms | 3088 KB | Output is correct |
2 | Correct | 41 ms | 3168 KB | Output is correct |
3 | Correct | 40 ms | 3096 KB | Output is correct |
4 | Correct | 40 ms | 3140 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 280 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 292 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 332 KB | Output is correct |
5 | Correct | 1 ms | 332 KB | Output is correct |
6 | Correct | 1 ms | 332 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 41 ms | 3208 KB | Output is correct |
3 | Correct | 40 ms | 3252 KB | Output is correct |
4 | Correct | 42 ms | 3244 KB | Output is correct |
5 | Correct | 42 ms | 3300 KB | Output is correct |
6 | Correct | 40 ms | 3244 KB | Output is correct |
7 | Correct | 40 ms | 3268 KB | Output is correct |
8 | Correct | 40 ms | 3204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 54 ms | 3260 KB | Output is correct |
3 | Correct | 40 ms | 3164 KB | Output is correct |
4 | Correct | 51 ms | 3136 KB | Output is correct |
5 | Correct | 45 ms | 3052 KB | Output is correct |
6 | Correct | 53 ms | 3144 KB | Output is correct |
7 | Correct | 80 ms | 3144 KB | Output is correct |
8 | Correct | 42 ms | 3140 KB | Output is correct |