自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Chip Factory

题目大意:给定数组找出三个数a[i],a[j],a[k];使的(a[i]+a[j])^a[k]最大http://acm.hdu.edu.cn/showproblem.php?pid=5536可以暴力。。。。。。#include <bits/stdc++.h>using namespace std;int a[2000];int main(){ int t;...

2018-08-30 14:26:26 159

原创 Almost Sorted Array

We are all familiar with sorting algorithms: quick sort, merge sort, heap sort, insertion sort, selection sort, bubble sort, etc. But sometimes it is an overkill to use these algorithms for an alm...

2018-08-30 14:18:08 471

原创 Amanda Lounges

AMANDA AIR has routes between many different airports, and has asked their most important frequent flyers, members of the AA Frequent Flyer program, which routes they most often fly. Based on this s...

2018-08-29 18:28:56 267

原创 Lucas定理

C_n^m\mod p(p为素数)   Lucas(n,m)=C(n,m)%p=C(n%p,m%p)*Lucas(n/p,m/p)%p 待补

2018-08-27 21:24:49 166

原创 欧几里得,扩展欧几里得,费马小定理:

欧几里得int gcd(int a,int b){ int r=a%b; while (r) { a=b;b=r;r=a%b; } return b;}https://blog.csdn.net/cqlf__/article/details/7953039扩展欧几里得int exgcd(int a,int b){ ...

2018-08-27 16:58:42 166

原创 再编号

链接:https://www.nowcoder.com/acm/contest/158/C来源:牛客网 n 个人,每个人有一个编号 ai 。定义对 a 的再编号为 a' ,满足 。现在有 m 次询问,每次给定 x,t ,表示询问经过 t 次再编号后第 x 个人的编号。由于答案可能很大,所以对 109+7 取模。输入描述:第一行 2 个数 n,m ,表示人数和询问次数;...

2018-08-26 14:53:57 224

原创 因数个数和

链接:https://www.nowcoder.com/acm/contest/158/A来源:牛客网 q次询问,每次给一个x,问1到x的因数个数的和。输入描述:第一行一个正整数q ;接下来q行,每行一个正整数 x输出描述:共q行,每行一个正整数表示答案 示例1输入复制412310输出复制13527转化为倍数的个数...

2018-08-26 13:26:23 1329

原创 Maximal Intersection

You are given nn segments on a number line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each ot...

2018-08-25 21:15:05 293

原创 坠落的蚂蚁

题目描述一根长度为1米的木棒上有若干只蚂蚁在爬动。它们的速度为每秒一厘米或静止不动,方向只有两种,向左或者向右。如果两只蚂蚁碰头,则它们立即交换速度并继续爬动。三只蚂蚁碰头,则两边的蚂蚁交换速度,中间的蚂蚁仍然静止。如果它们爬到了木棒的边缘(0或100厘米处)则会从木棒上坠落下去。在某一时刻蚂蚁的位置各不相同且均在整数厘米处(即1,2,3,…99厘米),有且只有一只蚂蚁A速度为0,其他蚂蚁均在...

2018-08-21 17:26:41 226

原创 袜子

题目描述    silchen有N只袜子(不区分左右脚),第i只袜子的颜色是Ci,在接下去的M天,他每天都要穿2只袜子出门。我们知道接下去的第i天,他将会穿编号为ai,bi的2只袜子。     众所周知,每天穿的2只袜子颜色要是一样的。现在silchen有机会更改任意袜子的颜色,他希望可以更改最少的袜子颜色,使得每一天穿的2只袜子颜色相同。 输入第一行输入一个T,代表数据组数,T小于...

2018-08-21 17:00:51 1411 1

原创 牛客第十场A

Today, Rikka is going to learn how to use BIT to solve some simple data structure tasks. While studying, She finds there is a magic expression  in the template of BIT. After searching for some literat...

2018-08-20 11:15:57 237

原创 牛客网多校第十场J

/*22lubenweiniubi3aaababblubenweiubiaabb*/#pragma GCC optimize(3)#include <bits/stdc++.h>using namespace std; const int MAXL=1000005,SIGMA=26; char s[MAXL],ans[MAXL];set &lt...

2018-08-20 11:08:33 210

原创 Sequence——HDU6395

Let us define a sequence as below F1=AF2=BFn=C⋅Fn−2+D⋅Fn−1+⌊P/n⌋   Your job is simple, for each task, you should output Fn module 109+7 .     Input The first line has only o...

2018-08-15 10:58:23 248

原创 HDU——1281 棋盘游戏

  Problem Description 小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下...

2018-08-10 16:58:36 210

原创 HDU ——1150——Machine Schedule

  Problem Description As we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history. Scheduling problems differ widely in the n...

2018-08-10 16:13:37 156

原创 A. Death Note Educational Codeforces Round 48 (Rated for Div. 2)

You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this not...

2018-08-04 10:01:41 188

原创 Educational Codeforces Round 48 (Rated for Div. 2) B——Segment Occurrences

You are given two strings s and t, both consisting only of lowercase Latin letters.The substring s[l..r] is the string which is obtained by taking characters sl,sl+1,…,sr without changing the order....

2018-08-04 09:44:07 316

原创 Chessboard poj2446(二分最大匹配

DescriptionAlice and Bob often play games on chessboard. One day, Alice draws a board with size M * N. She wants Bob to use a lot of cards with size 1 * 2 to cover the board. However, she thinks it ...

2018-08-03 18:48:49 229

原创 HDU1083Courses(模板题)

Problem Description Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee o...

2018-08-03 17:16:44 142

转载 KM算法详解+模板(转

转载自http://www.cnblogs.com/wenruo/p/5264235.htmlKM算法用来求二分图最大权完美匹配。本文配合该博文服用更佳:趣写算法系列之--匈牙利算法 本文没有给出KM算法的原理,只是模拟了一遍算法的过程。另,博主水平较差,发现问题欢迎指出,谢谢!!!! 现在有N男N女,有些男生和女生之间互相有好感,我们将其好感程度定义为好感度,我们希望把他...

2018-08-03 15:41:40 231

原创 A——gpa牛客多校2018第五场(二分

链接:https://www.nowcoder.com/acm/contest/143/A来源:牛客网 Kanade selected n courses in the university. The academic credit of the i-th course is s[i] and the score of the i-th course is c[i].At the un...

2018-08-03 09:20:33 172

空空如也

空空如也

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

TA关注的人

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