- 博客(5)
- 收藏
- 关注
原创 [CSP-J 2021]比赛题解
原序列为 1,1,4,5,6,71,1,4,5,6,7,修改为 1,1,9,5,6,71,1,9,5,6,7。同样的,我们可以维护一个有序数列,并记录原下标与先下标之间的关系(用数组记录),每次修改后更新这种关系。我们可以从前往后冒泡,再次维持了数列的有序。这样的操作是 \mathcal{O}(n)O(n) 的。这样,修改操作是 O(n) 的,查询是 O(1) 的。
2022-09-11 23:44:58
733
原创 洛谷P1657 选书 (题解)
大家好,没错,我又来了,今天心情不错,所以写了注释(大佬勿喷),先上题目 (不要问我为什么是Windows7)接下来直接上代码! #include<bits/stdc++.h>//万能头 using namespace std; int x; const int N=25; int a[N][2]; int st[1000];//用来存储 int ans; void dfs(int step) { if(step==x) { ans++; return ; } f.
2021-09-07 21:40:08
501
原创 1253:抓住那头牛(题解)
题解在下面,我只会把代码发出来,基本上没有注释(看心情啦),所以大家别嫌弃啊 #include<bits/stdc++.h> #define INF 0x3f3f3f3f #define PI acos(-1.0) #define N 100001 #define MOD 2520 #define E 1e-12 using namespace std; bool vis[N]; int dir[2]={-1,1}; struct node { int x; int step
2021-09-04 14:12:04
505
转载 整人代码(嘿嘿)
最近没事儿,就来发发博客(其实压根没发过)。 我属于那种不太爱写文章的,就爱整人,为了集赞,就把压箱底儿的整人代码拿出来了 废话少说,开胃菜来袭~ #include<stdlib.h> using namespace std; int main() { while(1) { system("start"); } //死循环弹出窗口 } 1 2 3 4 5 6 7 8 9 ↑:看了注释,知道干什么了吧???没错,无限弹窗的C++版。...
2021-09-04 13:53:57
1430
1
原创 贪吃蛇(源码)
想必大家都是从这个标题进来的(诶,第一次发博客),那我也就直接上代码,不多说话 #include <windows.h> #include <stdlib.h> #include <conio.h> #include <time.h> #include <cstring> #include <cstdio> #include <iostream> #define N 22 using namespace std;
2021-09-04 13:50:12
427
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人