hiho week 43 register

Ended

Participants:830

Verdict:Accepted
Score:100 / 100
Submitted:2015-05-02 00:51:30

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<iostream>
#include<cstring>
#include<cmath>
using namespace std;
#define _ARRSIZE  2048
#define _MOD    12357
struct RECORD{
    unsigned nx;
    unsigned ny;
    unsigned id;
    int iValue;
};
struct MATRIX{
    RECORD      *pArr;
    unsigned    nIndex;
    unsigned    nMemorySize;
};
int FindState(MATRIX *pMatrix,unsigned nxState){
    int i;
    for(i=0;i<pMatrix->nIndex;i++){
        if(pMatrix->pArr[i].nx==nxState)
            return 0;
    }
    return 1;
}
int FindState2(MATRIX *pMatrix,unsigned nxState,unsigned nyState){
    int i;
    for(i=0;i<pMatrix->nIndex;i++){
        if(pMatrix->pArr[i].nx==nxState&&pMatrix->pArr[i].ny==nyState)
            return 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX