返回顶部
摘要: Welcome 欢迎 您是第位访客 Dynamic 动态 2021-05-23 $\color{Red}{入坑}$ $\color{Red}{OI}$ 2021-10-23 $\color{Brown}{CSP} $ $\color{Brown}{2021}$ $\color{Brown}{提高组} 阅读全文
posted @ 2022-06-29 21:24 zrc4889 阅读(27) 评论(1) 推荐(0) 编辑
摘要: 目录 二分查找 二分答案 浮点二分 正文 二分查找 查找,即查找某个值在一个数列(有序)中的位置。 #include <bits/stdc++.h> using namespace std; int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int main() 阅读全文
posted @ 2022-05-08 22:07 zrc4889 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 前言 五一的第三天了。 正文 首先,今日的睡眠时间共8个小时(0:15~8:15) 原计划为(0:15~3:33)约3小时。 睡眠时间较上一周平均值(7.5小时)上升半小时。 良好开局,继续坚持。 历史和道法读了一遍(0:15,2022年5月3日) 数学作业全部完成,但是还有校本的最后一道和活页的选 阅读全文
posted @ 2022-05-08 22:07 zrc4889 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 题意 题目传送门 即将三个数排成升序所用的最小步骤与最大步骤 做法 分类讨论 已经排好了,最小 \(0\) 步,最大 \(0\) 步。 任意两个之间有空位,最小 \(1\) 步(另个数直接插入中间), 最大就是一个点一个点移动 都不满足,最小 \(2\) 步(另外两个数靠拢任意数),最大也是一个点一 阅读全文
posted @ 2022-02-11 15:07 zrc4889 阅读(24) 评论(1) 推荐(0) 编辑
摘要: 做法 一个个判断过去,类似递归。 如果此时子串为 \(eraser\),计数器$+5$,跳过这个子串。 如果此时子串为 \(erase\),计数器$+4$,跳过。 如果此时子串为 \(dream\),计数器$+4$,跳过。 如果此时子串为 \(dreamer\),注意$er$可能重复,要判断。 为 阅读全文
posted @ 2022-02-07 21:48 zrc4889 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 这道题重点是二进制,想不起来位移运算符了。 个人理解就是移 \(i\) 位,然后看看这个 \(i\) 位上的数字是不是 \(1\) 就行了。 \(Code\) #include <bits/stdc++.h> using namespace std; int n, m, a, sum = 0; // 阅读全文
posted @ 2022-02-05 16:11 zrc4889 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 题目的传送门 单纯用string暴力模拟,肯定超时,所以我们不能用数组或者字符串。 类似二分法!就是把由多个mooooo组成的字符串拆分成之后一个m与多个o组成的子串 找规律 #include <bits/stdc++.h> using namespace std; int n, t, k = 3, 阅读全文
posted @ 2022-01-28 08:43 zrc4889 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 设s为该点在地图上的状态。注意坐标都+2防止数组越界了。 因为卒行走的规则是可以向下、或者向右的。所以得出状态转移方程为 \(f(i, j) = f(i-1,j)+f(i,j-1)\) 第一次做 \(DP\) 题啊,还是有一些不懂的。 具体上 \(Code\) #include <bits/stdc 阅读全文
posted @ 2022-01-28 08:04 zrc4889 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 这道题需要分类讨论:一共五类(好多)。。 见下 遮了一个角 上半边 下半边 左半边 右半边 全部 #include <bits/stdc++.h> using namespace std; int main() { int l1, r1, l2, r2, x1, y1, x2, y2; cin >> 阅读全文
posted @ 2022-01-23 18:45 zrc4889 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 这道题纯模拟,开个数组照题目写。 #include <bits/stdc++.h> using namespace std; int m[2200][2200],ans=0; int main() { int a,d,s,f; for (int x=1; x<4; x++) { cin >> a > 阅读全文
posted @ 2022-01-23 11:08 zrc4889 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 注意这道题要考虑负数!不然数组越界RE #include <bits/stdc++.h> using namespace std; int n,a[105]; string t[105],cow[105]; int main(){ cin>>n; for (int i=1;i<=n;i++)cin> 阅读全文
posted @ 2022-01-22 18:42 zrc4889 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 这道题只有四个计算结果,取结果最大值就行了。 四个算式分别是: a+b+c a*b*c (a+b)*c a*b+c 上代码 #include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; int a 阅读全文
posted @ 2022-01-21 11:07 zrc4889 阅读(20) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; long long n,a[100001]; int main(){ long long k,m=0; cin>>n>>k; for (int i=0;i<n;i++){ cin>>a[i]; } sort( 阅读全文
posted @ 2022-01-21 09:55 zrc4889 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 逻辑十分简单 #include<bits/stdc++.h> using namespace std; int n; int a[200000010]; int ans = 2100000000; long long aa=0,bb=0,s; int main(){ cin>>n; for (int 阅读全文
posted @ 2022-01-21 09:45 zrc4889 阅读(26) 评论(0) 推荐(0) 编辑
摘要: \(1≤N≤100000\),$1≤Ai≤1000000000(=109) $$1≤Ai≤1000000000(=10 9)$ 这么大不能用数组存,用STL的set集合! #include <bits/stdc++.h> #include <set> using namespace std; set 阅读全文
posted @ 2022-01-20 22:17 zrc4889 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 一个简单的扫雷游戏模拟。 #include <bits/stdc++.h> using namespace std; int h,w; char s[51][51]; int f(int x,int y){ int ans=0; if (s[x-1][y-1] == '#') ans++; if ( 阅读全文
posted @ 2022-01-20 21:51 zrc4889 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 2022寒假第一篇! #include <bits/stdc++.h> using namespace std; long long a[1000001]; int main() { int n,temp,ans=0; cin >> n; for (int i=1;i<=n;i++){ cin>>t 阅读全文
posted @ 2022-01-20 21:14 zrc4889 阅读(29) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; const int maxn = 101; bool a[maxn]={0}; int main(){ int n; cin>>n; cout<<n<<endl; for (int i=0;i<n;i++){ 阅读全文
posted @ 2022-01-20 15:11 zrc4889 阅读(51) 评论(0) 推荐(0) 编辑
摘要: server.py import socket import threading def handle_client(c, addr): print(addr, "connected.") while True: data = c.recv(1024) if not data: break prin 阅读全文
posted @ 2022-01-19 21:28 zrc4889 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 服务端(server.py) from http import client import socket import sys # 创建对象 serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) # 获取本地的网络信息 h 阅读全文
posted @ 2022-01-15 21:06 zrc4889 阅读(26) 评论(2) 推荐(0) 编辑
摘要: 这道题的主要思路就是对生成的字符串进行化简。 模拟完成后string字符存不下,会爆。 所以我们用化简的思路,从几个方面考虑: 每个新字符串的第一个字符是原有字符串的最后一个字符 其他字符都是-1照搬 每一个新字符串的最后一个字符都是原有字符串的最后一个字符的前一个字符 可得: n /= 2 n = 阅读全文
posted @ 2022-01-08 22:25 zrc4889 阅读(48) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; int n; char a[10000][10000]; int h = 2, w = 4; // 储存初始三角形的大小 void print() { for (int i = 1; i <= h; i++) 阅读全文
posted @ 2022-01-08 22:24 zrc4889 阅读(44) 评论(0) 推荐(0) 编辑
摘要: int a[10001], n; void bubble_sort() { for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) if (a[i] < a[j]) swap(a[i], a[j]); } 首发于:https://www.luo 阅读全文
posted @ 2022-01-08 22:23 zrc4889 阅读(51) 评论(0) 推荐(0) 编辑
摘要: int a[10001], c[10001]; void Mergesort(int l, int r) { if (l >= r) return; int mid = (l + r) / 2; Mergesort(l, mid); Mergesort(mid + 1, r); int i = l, 阅读全文
posted @ 2022-01-08 22:22 zrc4889 阅读(18) 评论(0) 推荐(0) 编辑
摘要: Text 文本 声明 简易 auto text = new Text(L"你好"); 以上代码展示了如何将字符串存入text中。 复杂 auto text = new Text(L"你好", Font(L"宋体", 23, Font::Weight::Thin, true), style ); 以上 阅读全文
posted @ 2021-09-21 09:05 zrc4889 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 场景 代表游戏中的一个界面,你的游戏可以有类似主菜单、游戏界面、结束界面等多个场景。 创造场景 使用命令 auto scene = new Scene; 其中scene可以改为你想要的场景名称 gcnew:内存管理与垃圾回收,通过此命令可以将内存自动回收 SceneManager场景管理器 本章仅讲 阅读全文
posted @ 2021-08-14 09:32 zrc4889 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 常用元素 常用元素包括七大类 分别为Node, Text, Sprite, Button, ToggleButton, Menu, Shape 节点,文本,精灵,按钮,开关按钮,菜单,形状 七大元素都是Node节点的一种, 所以它们具备Node的所有性质 其他性质将会在之后的文档中另外提及。 aut 阅读全文
posted @ 2021-08-14 09:32 zrc4889 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Point 坐标点 Point 类表示一个二维坐标系中的点,具有 x 和 y 两个属性。 类定义 class Point { public: float x; // X 坐标 float y; // Y 坐标 public: Point(); Point(float x, float y); Poi 阅读全文
posted @ 2021-08-14 09:31 zrc4889 阅读(90) 评论(0) 推荐(0) 编辑
摘要: KeyCode 键值 类定义 包含了所有支持的按键 // 键盘键值 struct KeyCode { enum Value : int { Unknown = 0, Up = VK_UP, Left = VK_LEFT, Right = VK_RIGHT, Down = VK_DOWN, Enter 阅读全文
posted @ 2021-08-14 09:31 zrc4889 阅读(69) 评论(0) 推荐(0) 编辑
摘要: Game游戏类 init 初始化游戏,返回值为Bool,可以用于判断游戏是否初始化成功。 用法: //最简单的初始化,init参数中默认 if (Game::init()) {/*初始化成功*/} if (Game::init(L"Hello", 640, 480, L"")){/*初始化成功*/} 阅读全文
posted @ 2021-08-14 09:30 zrc4889 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 文件 Easy2d图形库 下载页面 如果使用Windows7,请下载Windows7专用包 注意是下载exe文件的! Visual Studio 版本务必为(2013,2015,2017,2019)之一 下载 下载好安装包后选择使用C++的桌面开发,等待安装 安装 首先先打开Easy2d的安装包 等 阅读全文
posted @ 2021-08-14 09:29 zrc4889 阅读(242) 评论(1) 推荐(0) 编辑