摘要:
点击查看代码 #include<bits/stdc++.h> using namespace std; const int MAXN = 405; int ans[MAXN][MAXN]; // 存储结果,同时也充当 visited 数组 int n, m, sx, sy; // 马的8个方向 in 阅读全文
摘要:
点击查看代码 #include <bits/stdc++.h> using namespace std; //s是学科数,a是题目个数 int s[4], a[25]; int n, sum, now_ans, final_ans; //1.状态定义,x是已经处理的题目个数,left是左脑处理的题目 阅读全文
摘要:
`#include include //用于 sqrt 函数 using namespace std; int n, k; int a[25]; // 题目说 n<=20,开稍大一点 int ans = 0; // 判断素数的函数 (标准模板) bool isPrime(int x) { if (x 阅读全文
摘要:
点击查看代码 #include <iostream> using namespace std; int N, M, T; // 地图长宽,障碍物数量 int SX, SY, FX, FY; // 起点坐标 (Start), 终点坐标 (Finish) int mp[10][10]; // 地图数组: 阅读全文
摘要:
点击查看代码 #include <iostream> using namespace std; // 题目说明 N, M <= 100,所以数组开稍微大一点防越界 const int MAXN = 105; int N, M; char field[MAXN][MAXN]; // 存地图 // 定义 阅读全文
摘要:
点击查看代码 #include<bits/stdc++.h> using namespace std; typedef pair<int,int> PII; int n; int a[35][35]; int dx[4]={0,0,1,-1}; int dy[4]={1,-1,0,0}; void 阅读全文