Submission #301662

#TimeUsernameProblemLanguageResultExecution timeMemory
301662llakiCarnival Tickets (IOI20_tickets)Java
11 / 100
239 ms16168 KiB
import java.util.Arrays; public class tickets { long find_maximum(int k, int[][] x) { int n = x.length; int m = x[0].length; int[][] answer = new int[n][m]; Arrays.sort(x, (i, j) -> i[0] + i[m - 1] - j[0] - j[m - 1]); long ans = 0; for (int i = 0; i < n; i++) Arrays.fill(answer[i], -1); for (int i = 0; i < n; i++) { if (i < n / 2) { answer[i][0] = 0; ans -= x[i][0]; } else { answer[i][m - 1] = 0; ans += x[i][m - 1]; } } grader.allocate_tickets(answer); return ans; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...