B. 沙漠之旅 Time Limit: 1000ms Case Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java class name: Main cid=5202#" class="submitprob button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" s…
[BZOJ5506][GXOI/GZOI2019]旅行者(最短路) 题面 BZOJ 洛谷 题解 正着做一遍\(dij\)求出最短路径以及从谁转移过来的,反过来做一遍,如果两个点不由同一个点转移过来就更新答案. #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; #define ll long long #define MAX 10…
Survival of Desert Life 沙漠生命的延续 ① Some desert animals can survive the very strong summer heat and dryness because they have very unusual characteristics.The camel,℃.In addition,it can drink an enormous amount of water ℃.Therefore,they must find some…
http://www.bnuoj.com/bnuoj/problem_show.php?pid=29376 我直接暴力搜索的. 剪枝: 1.步骤最多只有4步,超过4步则退出 2.油的行程相加后的总和距离大于剩余距离时也退出 AC代码: #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int yn; int a[1010]; bool cmp(int a, int b…