自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Dijkstra 最短路

A - 畅通工程续 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件结束。 每组数据第一行包含两个正整数N和M(0&lt...

2018-08-28 15:46:34 192

原创 A - 2016

数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量:    1. 1≤a≤n,1≤b≤m;   2. a×b 是 2016 的倍数。Input 输入包含不超过 30 组数据。 每组数据包含两个整数 n,m (1≤n,m≤10 9).Output对于每组数据,输出一个整数表示满足条件的数量。Sample Input...

2018-08-28 08:48:34 246

原创 B - Triangles

This is a simple problem. Given two triangles A and B, you should determine they are intersect, contain or disjoint. (Public edge or point are treated as intersect.)InputFirst line contains an int...

2018-08-22 10:07:28 635

原创 第二次组队赛——B - 报数游戏

n个人站成一行玩一个报数游戏。所有人从左到右编号为1到n。游戏开始时,最左边的人报1,他右边的人报2,编号为3的人报3,等等。当编号为n的人(即最右边的人)报完n之后,轮到他左边的人(即编号为n-1的人)报n+1,然后编号为n-2的人报n+2,以此类推。当最左边的人再次报数之后,报数方向又变成从左到右,依次类推。 为了防止游戏太无聊,报数时有一个特例:如果应该报的数包含数字7或者是7的倍数,他...

2018-08-03 21:01:51 469

原创 Phone list

Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:1. Emergency 9112. Alice 97 625 ...

2018-07-27 15:16:21 351

原创 字典树

B - 统计难题Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是...

2018-07-24 15:00:15 132

原创 B - Two-gram

Two-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, "AZ", "AA", "ZA" — three distinct two-grams.You are given a string ss consisting of nn capital Latin le...

2018-07-23 10:39:06 253

原创 Trainning 1 DAY

You are given a sequence of integers of length nn and integer number kk . You should print any integer number xx in the range of [1;109][1;109] (i.e. 1≤x≤1091≤x≤109 ) such that exactly kk elements of ...

2018-07-23 09:47:07 200

原创 快速幂

Given a positive integer N, you should output the most right digit of N^N. Input The input contains several test cases. The first line of the input is a single integer T which is t...

2018-04-24 09:52:35 112

转载 欧几里得

nn pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yuntai Mountain, labelled from 11 to nn. However, only two of them (labelled aa and bb, where 1≤a≠b≤n1≤a≠b≤n) withsto...

2018-04-08 20:35:07 146

原创 全排列算法

库函数next_permutation()应用,直接调用库函数参考文章#include <stdio.h>#include <algorithm>using namespace std;int a[4];int main(){ int i; while(~scanf("%d%d%d%d",&a[0],&a[1],&a[2],...

2018-04-04 08:59:07 289

原创 D-Prime Ring Problem

dfs 加油#include<queue>#include<cstdio>#include<cstring>#include<iostream>#include<string>#include<algorithm>#include<string.h>using namespace std;int n

2018-03-29 22:39:39 302

原创 HDU-2072

单词数#include<queue>#include<cstdio>#include<sstream>#include<iostream>#include<string>#include<set>#include<algorithm>#include<string.h>u

2018-03-26 21:37:42 240

原创 Red and Black

点击打开链接#include<cstdio>#include<cstring>#include<iostream>#include<queue>#include<string>#include<algorithm>#include<string.h>using namespace std;char

2018-03-23 19:35:39 138

原创 纪念我做对1次dfs题目啊

油田点击打开链接    #include<cstdio>#include<cstring>#include<iostream>#include<queue>#include<string>#include<algorithm>#include<string.h>using namespace std;

2018-03-21 22:15:56 159

原创 剪花布条

http://acm.hdu.edu.cn/showproblem.php?pid=2087HDU—2087Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用

2017-12-05 22:17:04 128

原创 HDU-2072

原题#include#includeint main(){ char st[100],g[100][1000]; int num,i,j; while(gets(st)) { if(strcmp(st,"#")==0) break; char *p=strtok(st," "); num=0;

2017-12-04 22:19:55 235

空空如也

空空如也

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

TA关注的人

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