- 博客(25)
- 收藏
- 关注
原创 【2020暑假牛客多校(一)】
牛客多校 AC:2,rank517AC : 2, rank517AC:2,rank517 7.127.127.12 题单 F(1271/5027)F(1271/5027)F(1271/5027) AC 【模拟(签到)】 H(140/1428)H(140/1428)H(140/1428) 补 【费用流】 $I(187/2699) $ 补 【开花 & 奇妙建图】 J(906/2933)J(906/2933)J(906/2933) AC 【数学】
2020-07-24 21:30:20
254
原创 hi
指针 无限弟归: 弟弟弟...弟弟_{弟_{弟..._{弟}}}弟弟弟...弟 本人水平有限,写这篇文章的时候有时候我自己有不是整太明白 希望大家带着批判的眼光看 有什么错误欢迎大家指出或与我讨论 一、指针和指针变量 指针就是地址 指针就是地址,地址就是指针 一个数据对象的内存地址称为该数据对象的指针 此处的地址不是机器的物理地址,而是虚拟地址 指针变量就是存放指针的变量 int a...
2019-11-30 10:10:39
310
原创 Educational_Round#76_(Div2)
Round#599(div2) 概要 A,B,C是水题,很快就a掉了,D题当时没有想出来,还看错了题目。 补题的时候用了python写abc,发现python真的好方便啊,牛逼。 看了官方的题解和别人的代码,觉得别人真的猛啊,自己思维题还是不够猛。 D. Yet Another Monster Killing Problem 题意: 给n个怪物的能力值,要按顺序击杀他们。 有m个勇士,每个勇士有能...
2019-11-16 16:18:27
223
原创 训练十三
题目 Problem A Secret of Chocolate Poles 题意就是有高度为1的黑块和白块,还有高度为k的黑块,要求底层和顶层都是黑色,问高度不超过h的所有摆放可能的方法 思路: 动态规划进行状态转移. 用dp[i][j] 来表示高度为i,顶层颜色为j时候的摆放方案数,j 为 0 代表白色,j 为 1代表 黑色 #include<bits/stdc++.h> us...
2019-10-06 20:43:31
246
原创 数据结构作业答案
#include<bits/stdc++.h> using namespace std; int cnt = 0; struct Node { int n, from, tmp, to,re; }; stack<Node>stk; void move(int from, int to) { cout << from << "->" ...
2019-10-06 18:59:38
301
原创 C.How_to_Fail_at_Programming_Contest
title: C.How_to_Fail_at_Programming_Contest date: 2019-10-05 22:20:11 categories: ACM tags: 背包 基础dp 最近比赛碰到了一道背包问题,大意就是在背包尽可能装的多的情况下 获取最小价值。给????整蒙⚪了。我就决定复习一下背包问题。 首先,回顾一下01背包和完全背包的转移方程 01背包 状态转移方程: ...
2019-10-05 22:21:34
259
原创 汉诺塔游戏,可以玩
用了easyx写了一个汉诺塔的实现过程,还挺好玩的 #include<bits/stdc++.h> #include<graphics.h> #include<Windows.h> #include<conio.h> using namespace std; vector<int>p[3]; void draw_rec() ...
2019-10-05 11:45:42
503
1
原创 汉诺塔递归
汉诺塔 #include<bits/stdc++.h> using namespace std; int cnt = 0; struct Node { int n, from, tmp, to; }; stack<Node>stk; void move(int from, int to) { //cout << from << "->...
2019-10-05 10:00:20
168
原创 训练十二
训练十二 题目链接 A.Valya and Letter 题意,给一个信的长宽,和信箱口的长宽,每次可以对折,问最少多少次能把信放进去。 #include<bits/stdc++.h> using namespace std; long long n, m, a, b; int main() { scanf("%lld%lld%lld%lld", &n, &m, ...
2019-10-04 16:52:03
220
原创 数据库作业(我裂开了
--创建student数据库 create database student on primary (name = 'stu', filename = 'D:\stu_data.mdf', size = 5mb, maxsize = 500mb, filegrowth = 10%) log on (name = 'stu_log', filename = 'D:\stu_log.ldf', siz...
2019-10-03 14:38:51
353
原创 Codeforces Round #590 (Div. 3)
A. Equalize Prices Again 题意:n件商品的价格依次为p1,p2…pn,想把他们全部设置成同样的价格,但不能亏钱,求最小的价格,T次查询 #include<bits/stdc++.h> #define int long long using namespace std; signed main(){ int t,n,sum; cin >...
2019-10-02 08:45:11
149
原创 dp水题
HDU-1087 是一个O(N²)的dp 具体见代码,注意要用long long #include<bits/stdc++.h> #define int long long using namespace std; int res[1010]; int A[1010]; signed main() { int n; while (scanf("%lld", &n) &a...
2019-09-23 23:24:08
193
原创 Kruskal模板(Poj1258)
//Poj 1258 #include<algorithm> #include<iostream> using namespace std; int u[10010]; int v[10010]; int w[10010]; int r[10010]; int p[110]; int n, m; int cmp(const int i, const int j) {...
2019-07-30 08:14:14
153
1
原创 Dijkstra模板
#include<bits/stdc++.h> using namespace std; const int maxn = 100050; const int INF = 0x3f3f3f3f3f3f3f3f; int n, m; struct Edge { int from, to, dist; Edge(int f, int t, int d) :from(f), to(t...
2019-07-30 08:13:16
144
原创 银联 第二场 (本弟弟只会做水题
A码队GO(找最大正方形) 代码: #include<bits/stdc++.h> using namespace std; int main(){ int T,n,m; cin >> T; while(T--){ cin >> n >> m; char tmp; int mat[n+2][m+2] = { 0 }; int ...
2019-07-22 09:51:07
155
1
原创 memset TLE的问题
我的代码 #include<bits/stdc++.h> using namespace std; int flag[500000]; int r[70000]; int c[70000]; int T,m,n; char mp; int main(){ cin >> T; while(T--){ memset(flag,0,sizeof(flag)); ...
2019-07-15 20:55:24
442
2
原创 市赛(天亡发际线队)
Problem A. dsy’s repeater #include<iostream> #include<string> using namespace std; int main(){ int a,b; cin >> a >> b; for(int i = 1;i <= a;i++){ string...
2019-04-22 22:43:48
206
原创 二分图的最小点集覆盖
学习链接:https://blog.youkuaiyun.com/dark_scope/article/details/8880547 这篇比较简单易懂 学习链接:https://www.cnblogs.com/wangjunyan/p/5563154.html 这篇更详细一些 学习链接:https://www.cnblogs.com/shenben/p/5573788.html 例题:https://vju...
2019-04-13 11:09:01
272
3
原创 拓扑排序
一,利用dfs进行拓扑排序 #include<iostream> using namespace std; /*---------------------------------------------- 代码比较乱,大概就是 c[]数组表示状态,-1表示正在dfs,1表示已经dfs完毕,0表示未访问 for (遍历所有节点v){ if(!c[v] && !dfs(v...
2019-04-12 15:29:48
238
1
原创 UVA 816 (写的全是bug,手动呲牙)
bfs失败。mark #include<iostream> #include<vector> #include<cstring> #include<queue> using namespace std; const int N = 15; int r1, c1, dir; int end_r, end_c; char title[1000]; co...
2019-04-09 23:23:39
179
原创 6-6 CheckBST[1] (30 分)
6-6 CheckBST[1] (30 分) Sample Input 1: (for the following tree) 4 Sample Output 1: Yes. Key = 5 Sample Input 2: (for the following tree) 3 Sample Output 2: No. Height = 3 误区:判断BST要用中序遍历,看是否递增。 而不能...
2019-04-01 12:49:06
1525
原创 7-4 判断素数 (10 分)(疯狂水题)
7-4 判断素数 (10 分) 本题的目标很简单,就是判断一个给定的正整数是否素数。 输入格式: 输入在第一行给出一个正整数N(≤ 10),随后N行,每行给出一个小于2 31 的需要判断的正整数。 输出格式: 对每个需要判断的正整数,如果它是素数,则在一行中输出Yes,否则输出No。 输入样例: 2 11 111 输出样例: Yes No #include<iostream>...
2019-03-26 23:00:14
4257
2
原创 7-1 正整数A+B (15 分)
我又来水题了/cy 7-1 正整数A+B (15 分) 题的目标很简单,就是求两个正整数A和B的和,其中A和B都在区间[1,1000]。稍微有点麻烦的是,输入并不保证是两个正整数。 输入格式: 输入在一行给出A和B,其间以空格分开。问题是A和B不一定是满足要求的正整数,有时候可能是超出范围的数字、负数、带小数点的实数、甚至是一堆乱码。 注意:我们把输入中出现的第1个空格认为是A和B的分隔。题目保证...
2019-03-26 22:50:03
1909
4
转载 L1-6 整除光棍 (20 分)
2019GPLT冲刺练习题集-2017总决赛重现 L1-6 整除光棍 (20 分) 这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾。然后,经过计算,输出两个数字:第一个数字s,表示x乘以s是一个光...
2019-03-23 09:43:53
282
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅