但我還是TLE了:)
卡在66%
package newpackage;
import java.io.*;
import java.util.*;
public class aaa {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Map<String, Character> a = new HashMap<>();
a.put("0 1 0 1",'A');
a.put("0 1 1 1",'B');
a.put("0 0 1 0",'C');
a.put("1 1 0 1",'D');
a.put("1 0 0 0",'E');
a.put("1 1 0 0",'F');
String line;
while ((line = br.readLine())!=null) {
int n = Integer.parseInt(line);
String k="";
for (int i = 0;i<n;i++)
k+= a.get(br.readLine());
System.out.println(k);
}
}
}
但我還是TLE了:)
卡在66%
package newpackage;
import java.io.*;
import java.util.*;
public class aaa {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Map<String, Character> a = new HashMap<>();
a.put("0 1 0 1",'A');
a.put("0 1 1 1",'B');
a.put("0 0 1 0",'C');
a.put("1 1 0 1",'D');
a.put("1 0 0 0",'E');
a.put("1 1 0 0",'F');
String line;
while ((line = br.readLine())!=null) {
int n = Integer.parseInt(line);
String k="";
for (int i = 0;i<n;i++)
k+= a.get(br.readLine());
System.out.println(k);
}
}
}
這題目是怎樣啊 我同一個代碼丟四次,有三次分數不一樣,我丟了第一次對4個側資後MLE,第二次只對1個就TLE,第三次就三個側資TLE了