QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#24253 | #2291. Lopsided Lineup | jskop | Compile Error | / | / | C | 789b | 2022-03-28 20:41:53 | 2022-05-18 04:15:47 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-05-18 04:15:47]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2022-03-28 20:41:53]
- 提交
answer
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Solution
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = "";
ArrayList<String> lines = new ArrayList<String>();
ArrayList<int> sums = new ArrayList<int>();
do {
line = reader.readLine();
}while(line!=null);
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);
var max = 0;
var 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);
}
详细
answer.code:1:1: error: unknown type name ‘import’; did you mean ‘short’? import java.util.*; ^~~~~~ short answer.code:1:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token import java.util.*; ^ answer.code:2:1: error: unknown type name ‘import’; did you mean ‘short’? import java.io.BufferedReader; ^~~~~~ short answer.code:2:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token import java.io.BufferedReader; ^ answer.code:3:1: error: unknown type name ‘import’; did you mean ‘short’? import java.io.IOException; ^~~~~~ short answer.code:3:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token import java.io.IOException; ^ answer.code:4:1: error: unknown type name ‘import’; did you mean ‘short’? import java.io.InputStreamReader; ^~~~~~ short answer.code:4:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token import java.io.InputStreamReader; ^ answer.code:6:1: error: unknown type name ‘public’ public class Solution ^~~~~~ answer.code:6:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Solution’ public class Solution ^~~~~~~~