摘要: 题解: 1 #include <bits/stdc++.h> 2 using namespace std; 3 const double ex = 1e-6; 4 double a[5]; 5 bool iseq(double a, double b) 6 { 7 return fabs(a - b 阅读全文
posted @ 2023-07-11 23:06 上原歩夢 阅读(46) 评论(0) 推荐(0)
摘要: 题解: 1 #include <iostream> 2 #include <algorithm> 3 #include <cstdio> 4 #include <cmath> 5 #include <cstring> 6 #include <vector> 7 #include <map> 8 #i 阅读全文
posted @ 2023-07-11 23:02 上原歩夢 阅读(31) 评论(0) 推荐(0)
摘要: 题解: 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 string init, result; // 要操作的,预期的 7 string temp; // 记录当前状态 8 cin >> init >> 阅读全文
posted @ 2023-07-11 22:58 上原歩夢 阅读(68) 评论(0) 推荐(0)
摘要: 题解: 思路:将A~L每个字母都枚举一遍(每个字母都有轻和重两种状态),看看是否符合输入数据条件 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 string Left[3], Right[3], Result[3]; 5 6 bool c 阅读全文
posted @ 2023-07-11 22:55 上原歩夢 阅读(50) 评论(0) 推荐(0)
摘要: 记忆化搜索 ——即把搜过的地方记录下来,后面再搜的时候直接取就好了 题解: 1 #include <iostream> 2 using namespace std; 3 #define ll long long 4 const int N = 100; 5 ll a[N], n; 6 ll dfs( 阅读全文
posted @ 2023-07-08 13:33 上原歩夢 阅读(24) 评论(0) 推荐(0)
摘要: 题解: 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 bool d[100]; // 记录棋盘主对角线能否放 5 bool c[100]; // 副对角线 6 bool b[20]; // 列 7 8 int a[20]; 9 10 // 阅读全文
posted @ 2023-07-06 00:00 上原歩夢 阅读(20) 评论(0) 推荐(0)
摘要: 题解: 1 #include <iostream> 2 #include <algorithm> 3 #include <cstdio> 4 #include <cmath> 5 #include <cstring> 6 #include <vector> 7 #include <map> 8 #i 阅读全文
posted @ 2023-07-05 21:52 上原歩夢 阅读(15) 评论(0) 推荐(0)
摘要: 这道题真是费了我好大力气(估计我还会回来看不少次qwq) 题解(DFS): 每个钟有4种情况,暴力枚举49种情况,这里只要一维数组就可以记录钟的状态(nowClock[] 和 oriClock[]) 1 #include <bits/stdc++.h> 2 using namespace std; 阅读全文
posted @ 2023-07-05 21:46 上原歩夢 阅读(116) 评论(0) 推荐(0)
摘要: 题解: 一条路走到头,然后再回头 vis数组来标记已走过的点,a数组来存数字 1 #include <bits/stdc++.h> 2 using namespace std; 3 int n; 4 bool vis[20]; 5 int a[20]; 6 7 void dfs(int x) 8 { 阅读全文
posted @ 2023-07-04 23:21 上原歩夢 阅读(33) 评论(0) 推荐(0)
摘要: 题解: 这道题重点是行号和列号 !千万! 别搞反了,还有就是用dx 和 dy数组表示顺时针转动 1 dx = [-1, 0, 1, 0] 2 dy = [0, 1, 0, -1] 3 n, m = map(int, input().split()) # n行m列 4 x, y, d = 0, 0, 阅读全文
posted @ 2023-07-04 22:31 上原歩夢 阅读(25) 评论(0) 推荐(0)