为什么这个过不去呀,只能得20分,但是我感觉没啥问题呀

P1319 压缩技术

XYJyuechu @ 2024-02-02 17:00:28

#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <cstring>
#define MAXN 210
using namespace std;
int a[MAXN][MAXN] ;
int main()
{
    int N  , i = 1 , j = 1 , k  , tmp = 0, tot = 0 ; 
    bool judge = true ;
    cin >> N ;
    tot = N*N ;
    while ( tot -- )
    {
        if ( tmp == 0 )
        {
            cin >> tmp ;
            judge = !judge ;
        }
        tmp -- ;
        if ( j != N )
        {
            a [ i ] [ j ++ ] = judge ;
        }
        else
        {
            a [ i ] [ j ] = judge ;
            i ++ ;
            j = 1 ;
        }
    }
    for ( i = 1 ; i <= N ; i ++ )
    {
        for ( j = 1 ; j <= N ; j ++)
        {
            cout << a [ i ] [ j ] ;
            if ( j == N && i != N )
            {
                cout << endl ;
            }
        }
    }
    return 0 ;
}

by XYJyuechu @ 2024-05-12 16:30:06

I AK IOI


|