竞赛讨论区 > 字符串排序 用例不通过
头像
ws&t
发布于 2022-09-28 13:28 浙江
+ 关注

字符串排序 用例不通过

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        Queue<String> pq = new PriorityQueue<>(n);
        for (int i = 0; i < n; i++) {
            pq.offer(sc.next());
        }
        System.out.println(pq.stream().reduce((x, y) -> x + " " + y).get());
    }
}


为什么会有一半用例不通过啊 想知道哪些用例没通过

全部评论

(0) 回帖
加载中...
话题 回帖

等你来战

查看全部

热门推荐