自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(28)
  • 问答 (1)
  • 收藏
  • 关注

原创 (KMP)剪花布条

传送门: 剪花布条 Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?  Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰...

2018-04-30 21:11:35 195

原创 (KMP)hdu4763 Theme Section

Theme Section Problem DescriptionIt's time for music! A lot of popular musicians are invited to join us in the music festival. Each of them will play one of their representative songs. To make t...

2018-04-30 17:16:58 125

原创 lower_bound和upper_bound

STL中的每个算法都非常精妙,接下来的几天我想集中学习一下STL中的算法。  ForwardIter lower_bound(ForwardIter first, ForwardIter last,const _Tp& val)算法返回一个非递减序列[first, last)中的第一个大于等于值val的位置。     ForwardIter upper_bound(ForwardI...

2018-04-29 14:15:56 186

原创 2018年湘潭大学程序设计竞赛题解

A-时间统计 (很简单,直接算也成)时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 某个实验需要统计时间,记录了实验开始和结束的时间,计算实验用了多少秒。 输入描述:第一行输入一个整数n,表示样例个数。接下来每组样例两行,表示开始时间和结束时间,格式为xdayHH:MM:SS,x是一个整数表示第几天...

2018-04-29 14:12:30 820

原创 (种类并查集)POJ1703 Find them, Catch them

点击打开链接 Find them, Catch themTime Limit: 1000MS   Memory Limit: 10000K Total Submissions: 50365   Accepted: 15464 DescriptionThe police office in Tadu City decides to say ends t...

2018-04-27 15:58:39 154

原创 (大数)Reversion Count

点击打开链接Description:There is a positive integer X, X's reversion count is Y. For example, X=123, Y=321; X=1234, Y=4321. Z=(X-Y)/9, Judge if Z is made up of only one number(0,1,2...9), like Z=11,Z=111,Z=...

2018-04-23 20:27:53 202

转载 素数判定Miller_Rabin 算法详解

素数判定Miller_Rabin 算法详解 例如:Goldbach#include<bits/stdc++.h>using namespace std;unsigned long long n;const int times = 5;int number = 0;unsigned long long Random( unsigned long long n ) ...

2018-04-23 20:08:01 427

原创 (递归转递推)Copy and Submit II

传送门Description:1// Q.cpp2#include <iostream>3using namespace std;4const long long M = 1000000007;5const long long MAXL = 1000000;6long long a[MAXL];7long long Q(int n, long long t)8{9    if(n &l...

2018-04-23 19:35:51 655

原创 (DFS)NYOJ20 吝啬的国度

描述在一个吝啬的国度里有N个城市,这N个城市间只有N-1条路把这个N个城市连接起来。现在,Tom在第S号城市,他有张该国地图,他想知道如果自己要去参观第T号城市,必须经过的前一个城市是几号城市(假设你不走重复的路)。输入第一行输入一个整数M表示测试数据共有M(1<=M<=5)组每组测试数据的第一行输入一个正整数N(1<=N<=100000)和一个正整数S(1<=S&l...

2018-04-21 15:01:37 156

原创 二维数组作为参数传递

#include<iostream>using namespace std;void f(int *a,int n,int m){ for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cout<<*(a+i*n+j)<<" "; } ...

2018-04-21 11:08:17 638

原创 (KMP裸题)hdu1711 Number Sequence

 Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K whic...

2018-04-19 21:25:23 163

原创 (KMP裸题)hdu1686 Oulipo

 Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pa...

2018-04-17 21:19:47 245

原创 (bfs)Meteor Shower

Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a sa...

2018-04-15 11:30:33 184

原创 (二维map)水果

 夏天来了~~好开心啊,呵呵,好多好多水果~~ Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了. Input第一行正整数N(0<N<=10)表示有N组测试数据. 每组测试数据的第一行是一个整数M(0<M<=100),表示工有M次成功的交易.其后有M行数据,...

2018-04-14 19:55:10 277

原创 2017年ACM第八届省赛J题:Company - SDUT3902

Problem DescriptionThere are n kinds of goods in the company, with each of them has a inventory of  and direct unit benefit . Now you find due to price changes, for any goods sold on day i, if its dir...

2018-04-14 15:31:00 558

原创 2017年ACM第八届山东省赛I题: Parity check(找规律)- SDUT3901

Problem DescriptionFascinated with the computer games, Gabriel even forgets to study. Now she needs to finish her homework, and there is an easy problem:f(n)=She is required to calculate f(n) mod 2 fo...

2018-04-13 20:37:16 232

原创 (同余与模算术)sum of power

Problem DescriptionCalculate  mod (1000000000+7) for given n,m.InputInput contains two integers n,m(1≤n≤1000,0≤m≤10).OutputOutput the answer in a single line.Sample Input10 0Sample Output10HintSourc...

2018-04-13 17:29:56 298

原创 2017年ACM第八届山东省赛F题:quadratic equation(离散数学蕴含式)- SDUT3898

Problem DescriptionWith given integers a,b,c, you are asked to judge whether the following statement is true: "For any x, if a⋅+b⋅x+c=0, then x is an integer."InputThe first line contains only one int...

2018-04-13 16:49:41 264

原创 (bfs或者dfs)Red and Black

There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can'...

2018-04-11 21:03:15 189

原创 (大数+递推)Children’s Queue

There are many students in PHT School. One day, the headmaster whose name is PigHeader wanted all students stand in a line. He prescribed that girl can not be in single. In other words, either no girl...

2018-04-10 22:44:43 351

原创 (大数相加)大菲波数

Fibonacci数列,定义如下: f(1)=f(2)=1 f(n)=f(n-1)+f(n-2) n>=3。 计算第n项Fibonacci数值。 Input输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)。 Output输出为N行,每行为对应的f(Pi)。 Sample Input512345Sample Output11235import...

2018-04-09 21:23:47 281

原创 (BigDecimal类有关的两个函数)hdu 1753 大明A+B

Problem Description话说,经过了漫长的一个多月,小明已经成长了许多,所以他改了一个名字叫“大明”。这时他已经不是那个只会做100以内加法的那个“小明”了,现在他甚至会任意长度的正小数的加法。现在,给你两个正的小数A和B,你的任务是代表大明计算出A+B的值。 Input本题目包含多组测试数据,请处理到文件结束。每一组测试数据在一行里面包含两个长度不大于400的正小数A和B。 Out...

2018-04-09 20:34:13 174

原创 (大数+sc.hasNext()处理多次读入问题)N!

Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file. OutputFor each N, output N! in one line. Sample Input123Sample Output126  解题:has...

2018-04-09 19:52:22 630

原创 (大数加法)A + B Problem II

Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the input contains an integer T(1<=T<=20) w...

2018-04-09 19:22:16 241

原创 (多重背包)Coins

CoinsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18021    Accepted Submission(s): 7085Problem DescriptionWhuacmers use coins.They have coins...

2018-04-08 15:24:57 200

原创 ACM省赛各届知识点总结

山东省第八届省赛 A:Return of the Nim(尼姆+威佐夫)B:打表找规律C: fireworks 杨辉三角+乘法逆元D. HEX(组合数学)E:三分+二分F:quadratic equation SDUT 3898 离散数学中的蕴含式   只有当前件成立后件不成立时输出  "NO"   其他情况都输出  "YES"   本题就是  当方程有解并且解不为整数时输出 "NO"  其他情况...

2018-04-07 15:57:52 651

原创 2015年北京师范大学新生程序设计竞赛题解

前四道题都是简单题,基本上半个小时就能解决。A. BQG's Programming ContestTime Limit: 2000msMemory Limit: 32768KB64-bit integer IO format: %lld      Java class name: MainSubmit Status PID: 50997又到了一年一度的北京师范大学新生程序设计竞赛!为作为良心出题...

2018-04-06 16:03:22 330

原创 (找规律)萌萌哒身高差

萌萌哒身高差“清明时节雨纷纷,路上行人欲断魂。”然而wfy同学的心情是愉快的,因为BNU ACM队出去春游啦!并且,嗯。。。以下是wfy同学的日记: 昨天,何老师告诉我们:明天我们去春游,大家准备好喝的和吃的哦!大家听了都兴奋起来,有的欢呼,有的鼓掌,开心得不得了。第二天,我们早早地来到学校,迫不及待地上了车,来到了公园。一进门,啊,太美了!公园中有那么多树,有高有矮,有粗有瘦,密密的,在春风吹拂...

2018-04-05 20:59:09 480

空空如也

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

TA关注的人

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