- 博客(11)
- 收藏
- 关注
原创 蓝桥杯试题 历届试题 打印十字图
问题描述 小明为某机构设计了一个十字型的徽标(并非红十字会啊),如下所示: ..$$$$$$$$$$$$$.. ..$...........$.. $$$.$$$$$$$$$.$$$ $...$.......$...$ $.$$$.$$$$$.$$$.$ $.$...$...$...$.$ $.$.$$$.$.$$$.$.$ $.$.$...$...$.$.$ $.$.$.$$$$$.$.$...
2020-02-25 21:03:43
258
原创 解题报告 CodeForces - 1296E1&E2
String Coloring (easy version) This is an easy version of the problem. The actual problems are different, but the easy version is almost a subtask of the hard version. Note that the constraints and t...
2020-02-11 19:15:20
678
原创 解题报告 CodeForces - 1300C Anu Has a Function
Anu has created her own function where denotes thebitwise OR operation. For example,. It can be proved that for any nonnegative numbersxxandyyvalue of is also nonnegative. She would like to ...
2020-02-10 13:50:01
295
原创 解题报告 CodeForces - 1295C Obtain The String
You are given two strings sand tconsisting of lowercase Latin letters. Also you have a string zwhich is initially empty. You want string zto be equal to string t. You can perform the following op...
2020-02-04 23:17:27
378
原创 递归 92. 递归实现指数型枚举
从 1~n 这 n 个整数中随机选取任意多个,输出所有可能的选择方案。 输入格式 输入一个整数n。 输出格式 每行输出一种方案。 同一行内的数必须升序排列,相邻两个数用恰好1个空格隔开。 对于没有选任何数的方案,输出空行。 本题有自定义校验器(SPJ),各行(不同方案)之间的顺序任意。 数据范围 1≤n≤151≤n≤15 输入样例: 3 输出样例: 3 2 2 ...
2019-11-17 22:11:20
292
原创 位运算 90. 64位整数乘法
求 a 乘 b 对 p 取模的值。 输入格式 第一行输入整数 a,第二行输入整数 b,第三行输入整数 p。 输出格式 输出一个整数,表示a*b mod p的值。 数据范围 1≤a,b,p≤1e18 输入样例: 3 4 5 输出样例: 2 差点粘个大数板子2333 思路: 1. b = b1 + b2 + b3 , a * b % p = ( a * b1 % ...
2019-11-14 23:21:22
193
原创 位运算 89. a^b
求 a 的 b 次方对 p 取模的值。 输入格式 三个整数 a,b,p 在同一行用空格隔开。 输出格式 输出一个整数,表示a^b mod p的值。 数据范围 0≤a,b,p≤1e9 输入样例: 3 2 7 输出样例: 2 快速幂取模居然WA了! 1.ll ans = 1 % p; 2.做题必看数据范围边界条件,是否有0,1等特殊值; 原理:1.(a*b) %...
2019-11-14 11:54:01
396
原创 解题报告 poj 2456 Aggressive cows
二分法查找位置 #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cstdio> using namespace std; int a[100005]; int n,c; int distan(int d)//...
2018-09-09 10:54:40
129
原创 解题报告 poj 2311 cutting game
cutting game Description Urej loves to play various types of dull games. He usually asks other people to play with him. H...
2018-07-27 16:01:17
271
原创 贪心算法——装箱问题
Central Europe 1996 Description 一个工厂制造的产品形状都是长方体,它们的高度都是h,长和宽都相等,一共有六个型号,他们的长宽分别为1*1, 2*2, 3*3, 4*4, 5*5, 6*6。这些产品通常使用一个 6*6*h 的长方体包裹包装然后邮寄给客户。因为邮费很贵,所以工厂要想方设法的减小每个订单运送时的包裹数量。他们很需要有一个好的程序帮他们解决这个问...
2018-07-12 00:01:09
1402
原创 博弈论
1.巴什博弈• 问题模型:只有一堆n个物品,两个人轮流从这堆物品中取物,规定 每次⾄至少取一个,最多取m个,最后取光者得胜• n%(m + 1) == 0时,先手败,否则先手胜。<抽象模型,有些要找规律>2.威佐夫博弈• 问题模型:有两堆各若干个物品,两个人轮流从某一堆或同时从两堆 中取同样多的物品,规定每次至少取⼀一个,多者不限,最后取 光者得胜。• 求解: ak =[k(1+√5...
2018-07-07 13:08:51
492
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人