int main(int argc, char const *argv[]) { int T; cin >> T; for (int i = 0; i < T; ++i) { int M, L; cin >> M >> L; vector<vector<int>> place(M, vector<int>(M, 0)); for (int j = 0; j < M; ++j) { for (int k = 0; k < M; ++k) { cin >> place[j][k]; } } int x, y; cin >> x >> y; vector<vector<double>> dist = diss(place, M, x, y); int rx, ry; while (true) { bool ans = getL(dist, L, rx, ry); if (!ans) { break; } else { L += place[rx][ry]; } } cout << L << endl; } system("pause"); return 0; }
点赞 评论

相关推荐

想run的马里奥在学...:这个学历帮你扫平百分之80的障碍,投就完了,这会找不到就等3月暑期一样能找到
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务