結果
| 問題 |
No.8063 幅優先探索
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-04-01 22:05:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,344 bytes |
| コンパイル時間 | 946 ms |
| コンパイル使用メモリ | 93,128 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 10:57:47 |
| 合計ジャッジ時間 | 1,343 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 9 |
ソースコード
//author:luckYrat(twitter:@luckYrat_)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <cctype>
#include <utility>
#include <climits>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const int mod = 1000000007;
const int inf = (1<<30)-1;
const ll linf = (1LL<<62LL)-1;
const double EPS = (1e-10);
#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)
#define pb push_back
#define fir first
#define scn second
#define ednl endl
#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")
P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
char mp[1000][1000];
struct z{
int x,y,p;
};
__attribute__((constructor))
void initial() {
cin.tie(0);
ios::sync_with_stdio(false);
}
int main(){
int x,y;cin>>x>>y;
int sy,sx,gy,gx;cin>>sy>>sx>>gy>>gx;
for(int i = 0; x > i; i++){
for(int j = 0; y > j; j++){
cin>>mp[i][j];
}
}
cout << abs(gy-sy)+1+abs(gx-sx)+1 << endl;
}