-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (64 loc) · 1.55 KB
/
index.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>我的代码库</title>
<style>
.text {
white-space: pre
}
body {
background-image: url('background.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;
}
</style>
</head>
<body>
<h1 align="center">我的代码库</h1>
<div style="color: #FFF333" class="text">
#include iostream
#include cstring
using namespace std;
int dx[4]={-1,1,0,0},
dy[4]={0,0,-1,1};
int h[40001][4];
bool a[201][201];
int main(){
int r,c,fx,fy,x,y,t,w;
char cs;
bool s;
cin>>r>>c;
memset(a,false,sizeof(a));
for(int i=1;i<=r;i++)
for(int j=1;j<=c;j++){
cin>>cs;
if(cs=='S') {
h[1][1]=i;
h[1][2]=j;
h[1][3]=0;
}else if(cs=='E'){
fx=i; fy=j;
a[i][j]=true;
}else if(cs=='.')
a[i][j]=true;
}
t=0;w=1;
s=false;
while(t<w){
t++;
for(int i=0;i<4;i++){
x=h[t][1]+dx[i];
y=h[t][2]+dy[i];
if(x>0 && x<=r && y>0 && y<=c && a[x][y]){
w++;
h[w][1]=x;
h[w][2]=y;
h[w][3]=h[t][3]+1;
a[x][y]=false;
if(x==fx && y==fy){
cout<<
</div>
</body>
</html>