刚才测试了一下,思路没问题,但是必须使用快速读写,不然会提示超时。建议下次出题给 Java 预留3秒,求求了~ import java.util.*; import java.io.*; public class Main { static boolean[] used = new boolean[2000001]; public static void main( String[] args ) throws Exception { In in = new In( System.in ); Out out = new Out( Syste...