版本比较
题解:AT_abc170_f [ABC170F] Pond Skater
正文
增加 5 行删除 5 行
12 行未改动1314151617171819192021212223242517 行未改动4344454647474849505152 行未改动10410510610710810810912 行未改动那么,就可以在原来的广搜模板上稍作改进,变成如下这样:```for(int i=0;i<4;i++){ for(int j=1;j<=k;j++)//新加的循环 for(int j=1;j<=k;j++)//新加的循环 { int nowx=now.x+dx[i]*j; int nowx=now.x+dx[i]*j; int nowy=now.y+dy[i]*j; //以及对现在的位置进行一些处理 //以及对现在的位置进行一些处理 }}```这样,本题的大致代码就差不多了。17 行未改动这样,我们就能愉快地通过这道~~很水的~~蓝题了。
# code```#include<bits/stdc++.h> #include<bits/stdc++.h>#define int long longusing namespace std;struct node{52 行未改动 bfs(); if(!vis[ex][ey]) cout<<-1<<"\n"; else cout<<vis[ex][ey]-1<<"\n"; return 0;} }```