# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
301674 | ijxjdjd | Carnival Tickets (IOI20_tickets) | Java | 84 ms | 10360 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
public class tickets {
long find_maximum(int K, int[][] x) {
int N = x.length;
int M = x[0].length;
int[][] S = new int[N*K][2];
for (int i = 0; i < N; i++) {
for (int j = 0; j < K; j++) {
S[i*K + j][0] = i;
S[i*K + j][1] = j;
}
}
Arrays.sort(S, new Comparator<int[]>() {
@Override
public int compare(int[] ints, int[] t1) {
return -Integer.compare(-x[ints[0]][ints[1]] - x[ints[0]][M - K + ints[1]], -x[t1[0]][t1[1]] - x[t1[0]][M-K+ints[1]]);
}
});
long res = 0;
ArrayList<Integer>[] low = new ArrayList[N];
ArrayList<Integer>[] high = new ArrayList[N];
for (int i = 0; i < N; i++) {
low[i] = new ArrayList<>();
high[i] = new ArrayList<>();
}
for (int i = 0; i < S.length/2; i++) {
low[S[i][0]].add(S[i][1]);
Compilation message (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... |