只过了7,8两个点,其他全部WA,样例能过
查看原帖
只过了7,8两个点,其他全部WA,样例能过
521537
日之朝矣楼主2022/1/14 22:44

瞪了好长时间,还是找不到问题出在哪里,没法下载测试数据,只好求助大佬们了TAT

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int flag = 1;
        int count = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (count == 0){
                    count = sc.nextInt();
                    flag = flag == 1 ? 0 : 1;
                }
                System.out.print(flag);
                count--;
            }
            System.out.println();
        }
    }
}
2022/1/14 22:44
加载中...