public class Main01 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); Queue<Integer> queue = new LinkedList<>(); for (int i = 0; i < n; i++) { queue.add(scanner.nextInt()); } int[] out = new int[n]; for (int i = 0; i < n; i++) { out[i] = scanner.nextInt(); } int count = 0; for (int i = 0; i < n-1; i++) { if(out[i]!=queue.peek()){ count++; }else { queue.poll(); } } System.out.println(count); } } 大佬,这样写有什么问题呀。
点赞 4

相关推荐

我不行了,我真过不了第二关
码农索隆:嘿,哥们连界面都进去去,更别提玩了
点赞 评论 收藏
分享
黑曼巴在线招人:草拟
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务