自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(148)
  • 收藏
  • 关注

转载 python:列表

列表通过列表可以实现整洁干净的输出,可使用title()方法让元素的格式更整洁。Python中的有非负索引,负索引。我们可以使用列表中的各个值修改列表元素转载于:https://www.cnblogs.com/drago...

2019-09-04 00:09:00 171

转载 深夜补最短路!

嘻嘻!https://cn.vjudge.net/contest/323530#problem/Ashow the code:#include<cstdio>#include<cstring>#include<algorithm>#define maxn 1005using namespace std;const i...

2019-09-03 01:42:00 176

转载 错题回顾总结:面积交

传送门:http://192.168.173.163/JudgeOnline/problem.php?cid=1244&pid=4解析:坐标系按照长短轴比例变换,之后相当于求两个等大的圆的面积交,求完后再乘上变换比例即可。#include<bits/stdc++.h>using namespace std;int main(){...

2019-08-20 22:13:00 234

转载 小总结:快速幂+贪心————Bit Mask____UVA 10718 多多去理解去温习哦!

传送门:https://vjudge.net/problem/UVA-10718Preview:bitstream:a flow of data in binary form.in bit-wise expression:用位表示。Her face was a cold blank mask.  她装出一副冰冷冷毫无表情的样子。perform a bit-wise A...

2019-08-20 21:43:00 127

转载 小总结:已知直角三角形的一条直角边,求另外两条边的长度!

#include<iostream>using namespace std;//An equation:a^2+b^2==c^2,已知a。//a=2*m,b=m*m-1,c=m*m+1;//a=2*m+1,b=2*m*(m+1),c=2*m*(m+1)+1. int main(){ int a,b,c; while(~scanf("%d",...

2019-08-20 16:35:00 3776

转载 小总结:fibonacci数的产生

我写的一个固定的函数来嘞:int fib[50]={1,1};void f(){ for(int i=2;i<46;i++) { fib[i]=fib[i-1]+fib[i-2]; }}1,1,2,3,5,8,13,21,34,55,......斐波那契博弈(Fibonacci Nim Game...

2019-08-20 16:22:00 94

转载 pick the stone game

我该如何去触摸这类问题嘞!取石子游戏1堆石子有n个,两人轮流取.先取者第1次可以取任意多个,但不能全部取完.以后每次取的石子数不能超过上次取子数的2倍。取完者胜.先取者负输出"Second win".先取者胜输出"First win".  输入有多组.每组第1行是2<=n<2^31. n=0退出.  先取者负输出"Second win"...

2019-08-20 16:09:00 102

转载 温故知新的错题训练:Coin game

传送门:http://192.168.173.163/JudgeOnline/problem.php?cid=1244&pid=1输赢规则:无法再放下硬币的人就输。博弈论的基本假定:他俩都按照最优策略进行游戏。有先手后手之分,此之为动态博弈(dynamic game.)均衡________所有局中人都选择的最优战略或行动的组合。人的经济行为的根本动机是自利,...

2019-08-20 15:02:00 379

转载 《博弈论的诡计》

"吠犬不咬人"对这个世界的最好描述可能只有其本身。囚徒困境:下下人有上上之智。根据情况可列写博弈收益矩阵,太精明往往会坏事哦,精明不等于高明哦。重复博弈:在车站这样人群流动性大的地方,不但商品和服务质量差,而且假货横行。对未来的预期是我们行为的重要因素。每一次的人际交往其实都可以简化为两种基本选择:合作还是背叛。在人际交往中普遍存在囚徒困境:双...

2019-08-20 14:12:00 299

转载 思维+博弈论:字符串操作

传送门:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1005&cid=856#include<iostream>using namespace std;int main(){ int T; cin>>T; while(T--) ...

2019-08-19 22:20:00 201

转载 一下午的编程思索录

1.  Rikka with Coin美国货币由美元dollar和美分cent组成,one dollar等于100 cents.其纸币bill有一、二、五、十、二十、五十和一百美元等面值;硬币(coin)有一美分(或a penny)、五美分(或a nickel)、十美分(或a dime)和二十五美分(或a quarter)等.在数字前加$表示美元,如:$500表示五百...

2019-08-19 22:19:00 167

转载 2018中国大学生程序设计竞赛 - 网络选拔赛---Find Integer!--hdu6441

问题传送门:https://vjudge.net/contest/320779#problem/D介绍一个名词:奇偶数列法则Key part:#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>usin...

2019-08-19 21:41:00 117

转载 任务调度问题(贪心) hdu4864

传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4864The company hopes to maximize the number of the tasks which they can complete today. If there are multiple solutions, they hopes to make the ...

2019-08-19 15:25:00 277

转载 B站学习记:贪心与博弈

贪心1.poj2287N匹马的田忌赛马问题稳稳地赢。寻找最优的方案。更优的收益。有时候,局部最优导致全局最优。马的能力值。使得让我赢的局数最多。对于对方的任何一匹马,如果我的马能打败它,那么我就要用能打败它的马里面能力值最小的马去迎战,如果我的马不能打败它,那么我就用剩下的所有马中能力最小的马去迎战。这个思路是很贪心的。贪心不是一板一眼的算...

2019-08-18 22:58:00 182

转载 poj1505(二分+贪心)

"最大值尽量小"是一种很常见的优化目标。关乎于炒书。题目见此:http://poj.org/problem?id=1505我的copy的代码如下:#include<iostream>#include<cstdio>#include<cstring>using namespace std;int book[505]...

2019-08-18 19:43:00 297

转载 温故知新:互质排列

每次询问给你一个区间[l,r],你有l,l+1,l+2,...,r这r-l+1数,现在问你这些数是否存在一种排列p1,p2...pn使得pi与pi+1互质。特别的要保证p1和pn也互质。题目地址:http://192.168.173.163/JudgeOnline/problem.php?cid=1244&pid=7题目分析:我的代码:#i...

2019-08-18 18:35:00 217

转载 Radar Installation(利用数据有序化进行贪心选择)

English appre:an infinite straight line:一条无限长的直线on the coasting:在海岸线上Cartesian coordinate system,题目地址:http://poj.org/problem?id=1328我的代码:#include<iostream>#include<cstdio...

2019-08-18 15:54:00 134

转载 Wooden Sticks(贪心)

Wooden Sticks.win the wooden spoon:成为末名。题目地址:http://poj.org/problem?id=1065There is a pile of n wooden sticks.a woodworking machine:木工机器。setup time:启动时间。my codes:#include<iostr...

2019-08-18 14:42:00 65

转载 Cats and Fish(小猫分鱼吃吱吱吱!)(我觉得是要用贪心的样子!)

炎炎夏日,一堆????放在那里,等着一众小猫君来拣择!题目地址:https://vjudge.net/contest/319950#problem/A题意我是初步理解了!已知:????的个数:m????的个数:n????的吃????能力的量化标准: _____min/条。设定:1.在有????力的状况下,猫是持续性吃鱼的,也就是吃完一条鱼的瞬间立刻去吞咽下一跳????(好是饥不择食嘞!????)...

2019-08-17 17:39:00 270

转载 计算a除b的第一位小数 in C++.

my codes:#include<iostream>#include<cstdio>using namespace std;int main(){ int a,b; while(~scanf("%d%d",&a,&b)) { int afterdot_1=(a*10)/b;/...

2019-08-17 01:05:00 101

转载 HDU-2037(贪心)

作为球迷,一定想看尽量多的完整的比赛,题目:https://vjudge.net/contest/317575#problem/B分析:看电视节目时电视节目开始得越晚结束的越早越好!这样才能实现目标是能看尽量多的完整节目!故://目标是能看尽量多的完整节目.//对节目按照结束时间从小到大排序,如果结束的时间相同,则按照开始的时间从大到小的排序!...

2019-08-16 13:38:00 51

转载 贪心算法 ()

English foundation:do some cleaning chores题目:https://cn.vjudge.net/contest/317575#problem/AHint:This problem has huge input data,use scanf() instead of cin to read data to avoid time limi...

2019-08-16 12:19:00 85

转载 Quality and CCPC

English foundation:the fractional part  小数部分disclaimer      免责声明fictitious      虚构的,编造的;假定的,虚设的;小说式的;假装的No two teams have the same name.round down the number  下取整proportion      比例,...

2019-08-15 15:06:00 135

转载 奶茶爱好者(贪心,二分图,)

英文预备:second to noneconduct a milk tea festivalmake many cups of milk teasavour(savor)品味,细品,享用;体味,享受。savor milk tea.题目地址:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1011...

2019-08-15 13:24:00 162

转载 Power of Cryptography

cryptography(密码学)#include<iostream>#include<cstdio>#include<cmath>using namespace std;int main(){ double x,y;//calculate y^(1/x) int k; while(scan...

2019-08-14 14:15:00 137

转载 Carmichael Numbers (快速幂)

  当今计算机科学的一个重要的领域就是密码学。有些人甚至认为密码学是计算机科学中唯一重要的领域,没有密码学生命都没有意义。  阿尔瓦罗就是这样的一个人,它正在设计一个为西班牙杂烩菜饭加密的步骤。他在加密算法中应用了一些非常大的素数。然而确认一个非常大的数是不是素数并不是那么简单。一个费时的方法是用比这个数的平方根小的所有素数去除它,对于大整数来说,这样一定会毁掉这个杂烩菜饭...

2019-08-14 10:40:00 360

转载 幂幂幂

解析:这是一个特判哦!代码:#include<bits/stdc++.h>using namespace std;int main(){ int t; scanf("%d",&t); while(t--) { int n; scanf("%d",...

2019-08-13 16:03:00 113

转载 异或(按位枚举位运算,十分美妙的错题,带我千百遍刷之熟练之!)

分析:#include<cstdio>#include<algorithm>#include<cstring>using namespace std;const int N = 55;int n;int cnt[N];//统计数组 int main() { int T,x,b; s...

2019-08-13 15:48:00 129

转载 The number of set(位运算+状态dp)一道十分美妙的题目哦!!!!!!

Given you n sets.All positive integers in sets are not less than 1 and not greater than m.If use these sets to combinate the new set,how many different new set you can get.The given sets can not ...

2019-08-13 14:11:00 308

转载 An easy problem(位运算)

As we known, data stored in the computers is in binary form.(数据以二进制形式存储于电脑之中。)The problem we discuss now is about the positive integers and its binary form.Given a positive integer I, you task...

2019-08-13 12:50:00 111

转载 位运算的“奇巧淫技”

#include<bits/stdc++.h>using namespace std;int getbits(int n)//统计(n)bin中的1的个数 { int res=0; while(n) { res++; n=n&(n-1); } r...

2019-08-13 12:05:00 169

转载 Binary Number(位运算)

#include<bits/stdc++.h>using namespace std;int n;int getBits1(int n)//求取一个数的二进制形式中1的个数. { int res=0; while(n) { if(n&1) res++; n>>=1; } return res;}...

2019-08-13 11:55:00 235

转载 位操作

解析:代码:#include<iostream>using namespace std;int main(){ int r,x,y; while(~scanf("%x,%d,%d",&r,&x,&y)) { //先左移x位,除了第x位为1其他位都是0:1<<x //再取反,除了...

2019-08-12 16:02:00 73

转载 小数(快速幂)

昨天下午做这道题目时真是摆置了好半天!惜哉,WA了!解析:代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;ll qmod(ll a,ll b,ll m){ ll ans=1; while(b) { if(b&1)...

2019-08-12 14:56:00 901

转载 我的快速幂固定模板

1.我们发现,在int型下使用pow函数求5的三次方,结果为124。原因:pow函数的返回值为double型,因浮点数长度问题,存在截断误差。_______________________________https://blog.csdn.net/liangllhahaha/article/details/82119378对于二进制的位运算,我们需要用到"&am...

2019-08-12 13:55:00 59

转载 Mike and Foam(位运算)

English reading:bartender == barmaid:酒吧女招待milliliter:毫升;千分之一毫升foam:泡沫a glass of beer with a good head of foam:上面有厚厚一层泡沫的一杯啤酒the greenness of the countryside:乡村的青葱翠绿geek题目:https...

2019-08-12 13:21:00 201

转载 写在快速幂模板之前的位运算介绍

先介绍一些位运算的技巧:&:  0&0==0&1==1&0==0  1&1==1|:   0|1 ==1|0 == 1|1 ==1  0|0==0我们程序里的所有数在内存里都是以二进制的形式存储的,位运算就是直接对这些二进制数进行运算。1. 位与运算 &相同位数的两个数都为1,就为1,如果有其中一个不是1,则为0。...

2019-08-12 12:33:00 98

转载 硬币游戏(博弈)

题目描述Alice和Bob在玩一种硬币游戏,Alice先手,他们轮流在一张长方形桌面上摆放圆形硬币,要求硬币不能有重叠,硬币边沿不能越过桌面边沿,无法再放下硬币的人就输,现在你知道了桌面的长宽n,m和硬币的直径r,请问他俩都按照最优策略进行游戏,谁会最终赢得这个游戏。输入第一行一个正整数T。(1<=T<=100)接下里T行每行三个整数n,m,r。(...

2019-08-12 10:12:00 1069

转载 Python记

在企业应用领域,Java或C#都是不错的选择。转载于:https://www.cnblogs.com/dragondragon/p/11332363.html

2019-08-10 17:33:00 46

转载 kmp算法散记

1.https://blog.csdn.net/abcjennifer/article/details/5794547#include<bits/stdc++.h>using namespace std;char t[1000001],p[10001]; //文本串t,模式串p ...

2019-08-10 15:46:00 68

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除