• 个人简介

    上完夏令营的赵辰颉:痛,太痛了 下面有惊喜👇

    藤本树无敌!

    作业(实时更新):

    #include <bits/stdc++.h>
    #include <cstring>
    using namespace std;
    
    int dx[]={0, 0, 1, -1};
    int dy[]={1, -1, 0, 0};
    int n ,m, sx, sy, cnt = 0;
    int mark[205][205];
    int vis[205][205], dn[205][205];
    
    struct node{
    	int x, y, step;
    };
    queue <node> q;
    
    int bfs(int x, int y){
        node t;
    	t.x=x;
    	t.y=y;
    	t.step=0;
    	q.push(t);
        if(vis[x][y]==-1){
            return 0;
        }
        return 0;
    }
    
    int main(){
    	cin >> n >> m;
        memset(vis, 0, sizeof(vis));
    	for(int i = 1;i <= n;i++){
    	    for(int j = 1;j <= m;j++){
    			cin >> mark[i][j];
    		}
    	}
    	for(int i = 1;i <= n;i++){
            for(int j = 1;j <= m;j++){
                if(mark[i][j] == 0){
                    for(int i=0;i<4;i++){
                    int nowx = i,nowy = j;
    			    while(nowx >= 1 && nowx <= n && nowy >= 1 && nowy <= m){
    				    vis[nowx][nowy] = -1;
    				    nowx+=dx[i];
    				    nowy+=dy[i];
                    }
    			}	
                cout << dn[i][j] << " ";
    		}else{
                cout << 0 << " ";
            }
            cout << endl;
        }
    	return 0;
    } 
    
  • 最近活动

    This person is lazy and didn't join any contests or homework.
  • 最近编写的题解

    This person is lazy and didn't write any solutions.
  • Stat

  • Rating