hiho week 159 register

Ended

Participants:533

Verdict:Accepted
Score:100 / 100
Submitted:2017-07-16 11:51:11

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "stdio.h"
#include <vector>
#include <stack>
#include <map>
#include <algorithm>
#include <set>
#include "string.h"
using namespace std;
int main(void){ 
    int N,M,x,y;
    int data[105][105];
    bool searched[105][105]={false};
    int dx[4] = { 0, 0, -1, 1 };
    int dy[4] = { -1, 1, 0, 0 };
    //FILE *file = fopen("hiho159.txt", "r");
    //fscanf(file,"%d%d%d%d", &N, &M, &x, &y);
    scanf("%d%d%d%d",&N,&M,&x,&y);
    for(int i=0;i<N;++i){
        for(int j=0;j<M;++j){
            //fscanf(file, "%d", &data[i][j]);
            scanf("%d",&data[i][j]);
            searched[i][j]=false;
        }
    }
    //fclose(file);
    int res=0;
    stack<pair<int,int>> keep;
    keep.push(make_pair(x,y));
    searched[x][y]=true;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX