QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#24260 | #2291. Lopsided Lineup | jskop | WA | 82ms | 38688kb | Java8 | 904b | 2022-03-28 20:48:30 | 2022-04-30 05:21:59 |
Judging History
answer
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Solution
{
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = "";
ArrayList<String> lines = new ArrayList<String>();
ArrayList<Integer> sums = new ArrayList<Integer>();
while(line!=null) {
line = reader.readLine();
lines.add(line);
}
int players = Integer.parseInt(lines.get(0));
for(int i=0; i<players; i++) {
int sum = 0;
for(String s: lines.get(i).split(" ")) {
sum += Integer.parseInt(s);
}
sums.add(sum);
}
Collections.sort(sums);
int max = 0;
int min = 0;
for(int i=0; i<players/2; i++) {
max += sums.get(players-i-1);
min += sums.get(i);
}
System.out.println((max-min)/2);
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 82ms
memory: 38688kb
input:
20 0 786505 911962 -800624 363821 -960995 -492637 -246590 140762 54707 -353306 -82216 -175650 567363 113374 761152 906126 -394096 -635055 675627 786505 0 801116 -323471 -34197 -860051 865281 737621 307515 -493253 -128788 -171663 -21931 853897 -505337 72985 941995 -380960 -223577 265322 911962 801116...
output:
21426130
result:
wrong answer 1st lines differ - expected: '21235600', found: '21426130'