摘要:
D | 驾驶卡丁车 代码 #include<iostream> #include<math.h> #include<string> using namespace std; int mov[8][2] ={ {-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1}, 阅读全文
posted @ 2022-01-23 21:41
Lewis_1231
阅读(49)
评论(0)
推荐(0)
摘要:
H | prime ring problem 质数环问题 题目分析 dfs递归搜索直到s=n时停止;停止时判断头和尾相加是否为素数; 这道题特别容易PE。。。 1.每一行末尾不能有空格 2.每一个case中间空行且第一个case前不能空行 代码 #include<iostream> #include 阅读全文
posted @ 2022-01-23 16:25
Lewis_1231
阅读(29)
评论(0)
推荐(0)
摘要:
M | Protect sheep 题目分析 搜索每只狼的位置,再将每只狼用狗围住 代码 #include<iostream> using namespace std; char squ[501][501]; int m, n; int flag = 1; int dir[4][2] = { {0, 阅读全文
posted @ 2022-01-23 16:12
Lewis_1231
阅读(35)
评论(0)
推荐(0)
摘要:
N | Maximum product 题目分析 1.遍历每一种情况大于max就替换 2.注意行末回车,否则会PE 3.EOF(end of file)按ctrl+z退出 代码 #include<iostream> #include<stdio.h> #include<math.h> #includ 阅读全文
posted @ 2022-01-23 16:03
Lewis_1231
阅读(45)
评论(0)
推荐(0)
摘要:
c | computer games 题目分析 只要存在一列上全部为1,就输出no; 代码 #include<iostream> using namespace std; int n, flag = 1; int main() { int t; cin >> t; while (t--) { cin 阅读全文
posted @ 2022-01-23 15:42
Lewis_1231
阅读(356)
评论(0)
推荐(0)
摘要:
B | knight moves 代码: #include<iostream> #include<queue> #include<string.h> using namespace std; int t, n; int sx, sy, ex, ey, nx, ny; int book[305][30 阅读全文
posted @ 2022-01-23 15:28
Lewis_1231
阅读(45)
评论(0)
推荐(0)

浙公网安备 33010602011771号