自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

ln2037的博客

用心雕琢我的艺术品

  • 博客(11)
  • 收藏
  • 关注

原创 CF 615 B. Collecting Packages

B. Collecting PackagesThere is a robot in a warehouse and npackages he wants to collect. The warehouse can be represented as a coordinate grid. Initially, the robot stays at the point (0,0). The i-t...

2020-01-23 00:55:48 456

原创 CF 615 C Product of Three Numbers

C. Product of Three Numberstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given one integer number n. Find three distinct integ...

2020-01-23 00:52:16 190

转载 lower_bound() 与 upper_bound()

头文件: #include <algorithm>二分查找的函数有 3 个: 参考:C++ lower_bound 和upper_boundlower_bound(起始地址,结束地址,要查找的数值) 返回的是数值 第一个 出现的位置。upper_bound(起始地址,结束地址,要查找的数值) 返回的是数值 最后一个 出现的位置。binary_search(起始地址,结束地址,要...

2020-01-19 13:00:04 185

原创 P1896 [SCOI2005]互不侵犯 【状压dp】

题目描述在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案。国王能攻击到它上下左右,以及左上左下右上右下八个方向上附近的各一个格子,共8个格子。注:数据有加强(2018/4/25)输入格式只有一行,包含两个数N,K ( 1 <=N <=9, 0 <= K <= N * N)输出格式所得的方案数输入输出样例输入 #13 2输出 #116#...

2020-01-18 16:56:40 235

原创 P1879 [USACO06NOV]玉米田Corn Fields 【状压dp】

题目描述Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regretta...

2020-01-17 14:40:28 194 2

原创 P2622 关灯问题II 【状态压缩&bfs】

题目描述现有n盏灯,以及m个按钮。每个按钮可以同时控制这n盏灯——按下了第i个按钮,对于所有的灯都有一个效果。按下i按钮对于第j盏灯,是下面3中效果之一:如果a[i][j]为1,那么当这盏灯开了的时候,把它关上,否则不管;如果为-1的话,如果这盏灯是关的,那么把它打开,否则也不管;如果是0,无论这灯是否开,都不管。现在这些灯都是开的,给出所有开关对所有灯的控制效果,求问最少要按几下按钮才能全部...

2020-01-16 17:13:11 231

原创 B 小琛和他的学校

链接:https://ac.nowcoder.com/acm/contest/4047/B来源:牛客网题目描述小琛是一所学校的校长。他的学校有n个校区(编号1~n),被n-1条双向道路连接,呈树形结构。第i个校区共有Ai个学生。第i天早上,所有的学生会沿最短路走到第i个校区参加活动,晚上再原路返回。一个人通过第j条通道一次(即一人次),需要小琛支付wj的维护费用。小琛想知道第n天结...

2020-01-16 15:06:27 220

原创 CF Round80 D Minimax Problem 二分+二进制

D. Minimax Problemtime limit per test5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given narrays a1, a2, …, an; each array consists of exactly m ...

2020-01-15 17:33:39 1643

原创 C 装货物

链接:https://ac.nowcoder.com/acm/contest/3781/C来源:牛客网题目描述有 n 件货物, 第 i 件重 wiw_iwi​ 吨,另有 x 个集装箱,每个集装箱可以装重量不超过 W 吨的货物。货物不能分拆,请判断这 x 个集装箱能否装下所有货物。输入描述:第一行一个整数 T ,表示数据组数。对于每组数据:第一行三个整数 n,x,W\text{}n,...

2020-01-15 11:36:30 268

原创 Codeforces Round 80 C. Two Arrays

C. Two ArraysYou are given two integers nand m. Calculate the number of pairs of arrays (a,b)such that:the length of both arrays is equal to m;each element of each array is an integer between 1 a...

2020-01-15 10:33:43 295

原创 kruskal

#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>using namespace std;const int maxn = 2e5 + 10;int father[maxn];int n, m;int cnt;struct node{...

2020-01-11 21:24:04 1523

空空如也

空空如也

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

TA关注的人

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