自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1020 Tree Traversals

Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the cor...

2018-08-23 15:26:40 192

原创 Joseph

HDU1443 Joseph 题目大意:已知n个人围成一个圈,对他们进行编号从0到n-1,从编号为0开始报数,报到m的出列,下一个继续从一开始报数,现在有k个好(编号为0~k-1)和坏人(编号为k~n-1),求使k个坏人全部死掉m最小要取多大;思路:一开始我是用暴力的方法直接枚举模拟,然后时间超限了,参考了https://blog.csdn.net/unin88/article/detai...

2018-07-22 17:46:30 208

原创 Radix

1010 Radix (25)(25 分)Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number.Now for ...

2018-07-17 16:41:59 883

原创 Counting Leaves

1004 Counting Leaves (30)(30 分)A family hierarchy is usually presented by a pedigree tree. Your job isto count those family members who have no child.InputEach input file contains one test case. Each ...

2018-07-15 17:24:41 403

原创 Emergency

1003 Emergency (25)(25 分)As an emergency rescue team leader of a city, you are given a specialmap of your country. The map shows several scattered cities connected bysome roads. Amount of rescue teams...

2018-07-15 15:45:21 472

原创 AtCoder Regular Contest 092-C

昨晚的比赛,只做了一题,还是记录一下吧;链接:https://arc092.contest.atcoder.jp/tasks/arc092_a题目大意:有n个点(a[i].x,a[i].y)和n个点(b[i].x,b[i].y)求可以取多少对(a[i].x,a[i].y),(b[i].x,b[i].y)其中a[i].x<b[i].c,a[i].y<b[i].y,不可重复取点;(为了与代...

2018-03-18 16:47:57 312

转载 食物链 (POJ-1182)

种类并差集:参见http://www.cnblogs.com/kuangbin/archive/2013/04/02/2996358.html;动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是...

2018-02-15 16:56:43 355

原创 Find them, Catch them(POJ-1703)

DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to ident...

2018-02-11 10:01:33 220

原创 Play on Words(HDU-1116)

Problem DescriptionSome of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the ...

2018-02-10 16:49:37 204

原创 牛客练习赛12

A-圆圆链接:https://www.nowcoder.net/acm/contest/68/A题目描述我们定义一个圆 C 为以原点 (0, 0) 为中心的单位圆(半径为 1 的圆)。给定在 C 圆周上相异的两点A, B。请问由 A 出发,沿着圆周走到 B,是顺时针走比较近,还是逆时针走比较近呢?C 的圆周上的所有点都可以用 (cos(t), sin(t)) 来表示,其中 t 的物理意义为角度。也...

2018-02-10 09:05:04 418

原创 Wormholes(POJ-3259)

While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that i

2018-02-07 10:43:37 400

原创 漫步校园(HDU-1248)

Problem DescriptionLL最近沉迷于AC不能自拔,每天寝室、机房两点一线。由于长时间坐在电脑边,缺乏运动。他决定充分利用每次从寝室到机房的时间,在校园里散散步。整个HDU校园呈方形布局,可划分为n*n个小方格,代表各个区域。例如LL居住的18号宿舍位于校园的西北角,即方格(1,1)代表的地方,而机房所在的第三实验楼处于东南端的(n,n)。因有多条路线可以选择,LL希望每次的

2018-02-06 16:11:15 303

原创 Sum It Up(HDU-1258)

Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and the list is [4,3,2,2,1,1],

2018-02-02 13:34:45 192

原创 Lake Counting(POJ-2386)

DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains

2018-02-02 10:28:45 899

原创 Rescue(HDU-1242)

Problem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angel's friends want to save Angel. Their task is: approach Angel.

2018-02-02 09:16:26 470

原创 Additive equations (ZOJ-1204)

We all understand that an integer set is a collection of distinct integers. Now the question is: given an integer set, can you find all its addtive equations? To explain what an additive equation is,

2018-02-01 11:38:41 259

原创 逃离迷宫(HDU-1728)

Problem Description  给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程

2018-01-30 15:16:53 373

原创 Prime Ring Problem(HDU-1016)

Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime

2018-01-29 11:34:30 210

原创 N皇后问题(HDU-2553)

Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output

2018-01-29 11:04:27 382

原创 Vampire Numbers(HDU-4235)

Problem DescriptionThe number 1827 is an interesting number, because 1827=21*87, and all of the same digits appear on both sides of the ‘=’. The number 136948 has the same property: 136948=146*938

2018-01-26 14:19:17 342

原创 Windows Message Queue(HDU-1509)

Problem DescriptionMessage queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as mouse click, text

2018-01-26 14:13:22 212

原创 Intelligent IME(HDU-4287)

Problem Description  We all use cell phone today. And we must be familiar with the intelligent English input method on the cell phone. To be specific, the number buttons may correspond to some Eng

2018-01-26 14:10:19 272

原创 sort(HDU-3293)

Problem DescriptionAs is known to all, long long ago sailormoon once was an association of fighters. Till now, sailormoon is also an association of girls. Owe to some unknown reasons, girls are ne

2018-01-26 13:49:14 198

原创 Bombing(HDU-4022)

Problem DescriptionIt’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base.It seems not to be a hard work in circumstanc

2018-01-26 13:42:03 359

原创 The kth great number(HDU -4006)

Problem DescriptionXiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the numbe

2018-01-24 17:14:22 442

原创 水果(HDU-1263)

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

2018-01-23 09:11:28 289

原创 Humble Numbers(HDU-1058)

Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the fir

2018-01-21 08:21:43 284

原创 Light Bulb

题目链接:https://vjudge.net/contest/181589#problem/A纯数学方法即可代码如下:#include#includeint main(){ int t; scanf("%d",&t); for(int i=1;i<=t;i++) { double H,h,D,L; scanf("%

2017-10-05 15:07:50 408

原创 Super Sum

题目链接:https://vjudge.net/contest/174844#problem/J;题意:给一群a,b,c,求解a1^m1*a2^m2*a3^m3*a4^m4......an^mn所有可能的和,其中b思路:看到这题的时候,我联想到了求n因子的公式,设n=p1^e1*p2^e2*P3^e3*p4^e4......,则n的所有因子的和为:(1+p1+p1^2+p1^3+.

2017-08-09 09:46:10 573

原创 Frogs

Problem DescriptionThere are m stones lying on a circle, and n frogs are jumping over them.The stones are numbered from 0 to m−1 and the frogs are numbered from 1 to n. The i-th frog c

2017-08-04 09:23:17 643

原创 Sum

Problem DescriptionXXX is puzzled with the question below: 1, 2, 3, ..., n (1Operation 1: among the x-th number to the y-th number (inclusive), get the sum of the numbers which are co-prim

2017-08-04 09:07:09 254

原创 Co-prime

Problem DescriptionGiven a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N.Two integers are said to be co-prime or relatively pr

2017-08-03 21:53:20 419

原创 The Boss on Mars

Problem DescriptionOn Mars, there is a huge company called ACM (A huge Company on Mars), and it’s owned by a younger boss.Due to no moons around Mars, the employees can only get the salaries p

2017-08-03 21:10:32 373

原创 Coprime

Problem DescriptionPlease write a program to calculate the k-th positive integer that is coprime with m and n simultaneously. A is coprime with B when their greatest common divisor is 1.InputThe...

2017-08-03 20:10:11 994 3

原创 GCD

Problem DescriptionGiven 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices ma

2017-08-03 19:50:09 660

原创 X问题

Problem Description求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod a[i] = b[i], … (0 Input输入数据的第一行为一个正整数T,表示有T组测试数据。每组测试数据的第一行为两个正整数N,M (0 Output

2017-08-03 19:46:31 440

原创 A/B

Problem Description要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 Output对应每组数据输出(A/B)%9973。Sample Input21000 53

2017-04-27 16:38:04 354

原创 Romantic

Problem DescriptionDo you have spent some time to think and try to solve those unsolved problem after one ACM contest?No? Oh, you must do this when you want to become a "Big Cattle".Now you will

2017-04-27 11:39:51 263

空空如也

空空如也

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

TA关注的人

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