
技巧题
文章平均质量分 74
风动护花
喜欢我你就关注我,有话说你就评论我,没话说你就点个赞≖‿≖✧
展开
-
hsacm-1575
题目描述“如果两个人相差一秒出生,其中一个是小孩,那么另一个也是小孩。由此可以推论,所有人均是小孩。”数计系是一个由N个人组成的大家庭,分别为1, 2, 3, ..., N岁。 有一次系主任想为全系拍张合照,需要所有学生站成一排。起先他想按他们的岁数从小到大安排,但后来又觉得这样不自然。于是他建议按如下方案站排: 1岁的在最左边。 每相邻两人不得相差超过2岁。原创 2015-05-14 18:26:25 · 979 阅读 · 0 评论 -
CF 554B Ohana Cleans Up
B. Ohana Cleans Uptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOhana Matsumae is trying to clean a room原创 2015-10-22 21:13:57 · 365 阅读 · 0 评论 -
CF 158D Ice Sculptures
D. Ice Sculpturestime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Berland University is preparing to ce原创 2015-10-22 22:01:20 · 516 阅读 · 0 评论 -
CF 500C New Year Book Reading
C. New Year Book Readingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNew Year is coming, and Jaehyun de原创 2015-11-09 18:37:54 · 692 阅读 · 0 评论 -
CF 584B Kolya and Tanya
B. Kolya and Tanyatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputKolya loves putting gnomes at the circle原创 2015-10-25 21:02:59 · 582 阅读 · 1 评论 -
CF 546C Soldier and Cards
C. Soldier and Cardstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo bored soldiers are playing card wa原创 2015-10-26 22:23:11 · 620 阅读 · 0 评论 -
CF 466C Number of Ways
C. Number of Waystime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got array a[1], a[2], ..., a[n], c原创 2015-10-30 18:41:11 · 582 阅读 · 0 评论 -
CF 588B Duff in Love
B. Duff in Lovetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is in love with lovely numbers! A posi原创 2015-10-30 20:20:29 · 786 阅读 · 0 评论 -
HDU 新生赛 一道递推题
http://blog.youkuaiyun.com/loy_184548/article/details/50100179转载 2015-12-04 18:16:29 · 424 阅读 · 0 评论 -
1065. A+B and C (64bit) (20)
Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.Input Specification:The first line of the input gives the positive number of test cases, T (<=10). Then T test c原创 2017-03-05 19:48:44 · 529 阅读 · 2 评论 -
CF 723A The New Year: Meeting Friends
题目链接:http://codeforces.com/problemset/problem/723/AA. The New Year: Meeting Friendstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are ...原创 2019-02-16 10:38:41 · 1242 阅读 · 0 评论 -
CF 1130A Be Positive
A. Be Positivetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array of n integers: a1,a2,…,an. Your task is to find some non-...原创 2019-02-27 13:19:41 · 197 阅读 · 0 评论 -
PAT 1051复数相乘
https://pintia.cn/problem-sets/994805260223102976/problems/9948052744963194881051 复数乘法 (15 分)复数可以写成 (A+Bi) 的常规形式,其中 A 是实部,B 是虚部,i 是虚数单位,满足 i2 =−1;也可以写成极坐标下的指数形式 (R×e(Pi) ),其中 R 是复数模,P 是辐角,...原创 2019-08-24 09:57:11 · 178 阅读 · 0 评论 -
CF 509B Painting Pebbles
B. Painting Pebblestime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputThere are n piles of pebbles on the原创 2015-11-06 20:48:00 · 472 阅读 · 0 评论 -
CF 501B Misha and Changing Handles
B. Misha and Changing Handlestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMisha hacked the Codeforces si原创 2015-11-07 14:25:48 · 634 阅读 · 0 评论 -
cf-379C
技巧题:给出一串的数字,比如5 1 1,输出不能包含重复的数字而且总和尽量小的串。解法:用排序,排完之后遍历,比较目前值和前一个的值+1的大小。取大的数字#include #include #include #include #include #include #include #include #include #include #include #include #in原创 2015-05-16 20:24:38 · 492 阅读 · 0 评论 -
zoj-1002
这题说得是防火墙。个人理解:炮塔能打他所在的这一行和这一列,如果子弹遇到防火墙就会停止,如果遇到其他炮塔就打掉,所以,问你图里面能放最多多少个炮塔做法:设置一个函数ISOK判断这个位置能不能放炮塔,如果上下左右四个方向,有遇到炮塔的就返回0 ,其中如果当前点是防火墙也不能放置炮塔,也是0;然后直接遍历一遍数组,把所有能放置炮塔的计算出来。#include #include #i原创 2015-06-04 21:36:33 · 538 阅读 · 0 评论 -
cf-289B
题意:给一个矩阵和一个值D,矩阵内每个元素可以多次加减D,目的是让整个矩阵的元素都变得相等,如果做不到输出-1首先,矩阵是多余的,直接一个数组就行了,无非是让数组元素都相等从判断差值是不是倍数的问题入手,对于两数字A,B,如果它们的差值不是D的倍数,那么无论它们怎么加减都没办法变得一样,只要一对数字不行,整个序列就失败了对于两数字A,B,它们的差值是D的倍数,例如k原创 2015-06-04 21:08:58 · 910 阅读 · 0 评论 -
hsacm-1441
http://hsacm.cn/JudgeOnline/problem.php?cid=1009&pid=6题目描述Saya likes math, because she think math can make her cleverer.One day, Kudo invited a very simple game:Given N integers, then th原创 2015-05-23 11:37:16 · 650 阅读 · 0 评论 -
HDU 4788 Hard Disk Drive
Hard Disk DriveTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1859 Accepted Submission(s): 1023Problem Description Yesterday your dea原创 2015-07-10 23:28:00 · 650 阅读 · 0 评论 -
HDU 3123 GCC
GCCTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 4266 Accepted Submission(s): 1401Problem DescriptionThe GNU Compiler Collection (u原创 2015-07-13 20:47:21 · 505 阅读 · 0 评论 -
ICPC 6789 Superstitious Socks
题目意思是,这个人有很多袜子。socks(袜子的复数)但是他每只袜子长度都不一样。他每天穿一对长度差最小的袜子,穿完之后第二天就换,也就是说,每一对匹配出来的袜子他只会穿一天。求第K天他穿的袜子长度。解法:直接暴力是不对的。先对两只袜子的长度差进行二分。然后再查找长度差的值。关键在,计算这个长度差范围之内的袜子匹配种数。应为对袜子排序过。所以可以看出,中间一大段都是重复的计原创 2015-09-08 21:11:57 · 598 阅读 · 0 评论 -
ICPC 6823 Counting substhreengs
题意:求出满足要求的子串个数,要求是:子串都是数字,并且能被3整除。做法:动态规划的思想。弄一个数组记录当前选定值之前的情况,num[0]记录余数为0的个数。假设选定当前值作为数字的最后一个位数,如果当前值mod3等于1,那么前面num[2]的数加上当前值都能变成余数0,所以num[0]=num[2].以此类推......不用long long 会wa。#include#includ原创 2015-09-03 12:51:53 · 637 阅读 · 0 评论 -
ICPC 6834 Shopping
题意:有一个人去市场上买东西,他要穿越整个市场。市场是一条直线,线上有N家店。一般这个人不会去买东西,但是会有一个限制条件,比如C1,D1;意思是,想要路过D1店,必须返回C1店买东西,然后再回来。。所以最短的路线就是,直接穿越整个市场的路程加上重复的区间 。#include#includeusing namespace std;typedef struct pp{ int first原创 2015-09-06 12:45:07 · 502 阅读 · 0 评论 -
HDU 3826 Squarefree number
Squarefree numberTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2754 Accepted Submission(s): 695Problem DescriptionIn mathemati原创 2015-10-02 10:30:01 · 540 阅读 · 0 评论 -
HDU 3819 A and B Problem
A and B ProblemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 786 Accepted Submission(s): 251Problem DescriptionAfter calculatin原创 2015-10-02 10:56:30 · 584 阅读 · 0 评论 -
CF 591B Rebranding
B. Rebrandingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe name of one small but proud corporation c原创 2015-11-04 16:18:17 · 546 阅读 · 0 评论 -
PAT 1101 Quick Sort
https://pintia.cn/problem-sets/994805342720868352/problems/9948053663431884801101 Quick Sort (25 分)There is a classical process named partition in the famous quick sort algorithm. In this process we...原创 2019-08-28 10:22:48 · 144 阅读 · 0 评论