
思维
pioneer 1
如你所说,成为传奇。
展开
-
每日咕咚
传送门这道题是道简单思维题,做出来的人少真亏,认真思考下其实很简单。每个人在队中不同的排名下有不同的追赶速度,而他需要超过前面的n-1个同学,然后再跑x距离。他首先需要用第n位的速度追赶第n-1位,然后用第n-1位的速度追赶第n-2位,然后用第n-2位的速度追赶第n-3位。。。直到他用第1位的速度再跑x距离,他就完成自己的任务。那么,一个人从第i位跑到第i-1位所用的时间为x/(Vi-1 - V平均),利用循环把从i=n到i=1的时间加起来就是这个人所用的时间。每个人都是如此,那么可以推断出..原创 2020-10-27 21:45:54 · 144 阅读 · 0 评论 -
第十一届蓝桥杯——整数拼接
传送门题解:如果是暴力做法的话,肯定是两个循环遍历一下就行,时间复杂度是O(n^2),但是就这道题而言肯定会超时。要想计算出有多少种拼法满足两个整数拼出的整数是k的倍数,必须遍历到每一个数,即外层循环必不可少,那如何将内层循环O(n)降下来呢。先将表达式写出来,假如找到两个数Ai和Aj,那么拼出来的数就是Ai*(10^(len(Aj))+Aj,例如12和345拼起来就是12*(10^3)+345,它的余数(Ai*(10^(len(Aj))+Aj)%k就等于((Ai%k*(10^len(.原创 2020-09-01 20:06:15 · 2805 阅读 · 3 评论 -
1009 Divisibility
Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2613Accepted Submission(s): 843Problem DescriptionYou are given two10-based integersbandx, and you are required to determine the followin...原创 2020-08-09 16:06:51 · 127 阅读 · 0 评论 -
Alter Altar
Time Limit: 2 sec / Memory Limit: 1024 MBScore :400400pointsProblem StatementAn altar enshrinesNNstones arranged in a row from left to right. The color of theii-th stone from the left(1≤i≤N)(1≤i≤N)is given to you as a charactercici;Rstands ...原创 2020-08-03 17:56:22 · 227 阅读 · 0 评论 -
C - Repsept
Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementTakahashi loves the number77and multiples ofKK.Where is the first occurrence of a multiple ofKKin the sequence7,77,777,…7,77,777,…? (Also see Output and Sample Inp...原创 2020-08-03 17:36:26 · 545 阅读 · 0 评论 -
Kindergarten Physics
Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1392Accepted Submission(s): 970Special JudgeProblem DescriptionZhang3 a participant of IPhO (Immortal Physics Olympiad). The0thproblem i...原创 2020-07-31 09:30:26 · 209 阅读 · 0 评论 -
6799 Parentheses Matching
传送门Time Limit: 2000/2000 MS (Java/Others)Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 589Accepted Submission(s): 253Problem DescriptionGiven a stringPconsisting of only parentheses and asterisk characters (i.e. "(", ")" ...原创 2020-07-30 11:59:23 · 241 阅读 · 0 评论 -
C - Hilbert's Hotel
Hilbert's Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one room for every integer,including zero and negative integers. Even stranger, the hotel is c...原创 2020-05-08 13:52:52 · 362 阅读 · 0 评论 -
B. Card Constructions
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA card pyramid of height11is constructed by resting two cards against each other....原创 2020-05-08 12:12:02 · 483 阅读 · 0 评论 -
Pairs(暴力,超详细简单)
传送门Toad Ivan hasmmpairs of integers, each integer is between11andnn, inclusive. The pairs are(a1,b1),(a2,b2),…,(am,bm)(a1,b1),(a2,b2),…,(am,bm).He asks you to check if there exist two intege...原创 2019-11-28 17:14:24 · 1988 阅读 · 0 评论 -
Nick and Array
传送门Nick had received an awesome array of integersa=[a1,a2,…,an]a=[a1,a2,…,an]as a gift for his55birthday from his mother. He was already going to explore its various properties but after unpacki...原创 2019-11-25 21:39:59 · 233 阅读 · 0 评论 -
Traffic (难度不够,题意来凑?)
传送门Avin is observing the cars at a crossroads. He finds that there are n cars running in the east-west direction with the i-th car passing the intersection at time ai . There are another m cars runn...原创 2019-11-10 18:11:49 · 541 阅读 · 0 评论 -
Equalizing by Division 思维
传送门The only difference between easy and hard versions is the number of elements in the array.You are given an arrayaaconsisting ofnnintegers. In one move you can choose anyaiaiand divide it ...原创 2019-09-27 11:44:39 · 290 阅读 · 0 评论 -
K-Dominant Character(思维)
传送门You are given a stringsconsisting of lowercase Latin letters. Charactercis calledk-dominant iff each substring ofswith length at leastkcontains this characterc.You have to find minimu...原创 2019-09-23 21:53:05 · 406 阅读 · 0 评论 -
最小值最大值
题目链接给出一个有n个整数的数组a1, a2, ..., an和一个整数k。你被要求把这个数组分成k个非空的子段。 然后从每个k个子段拿出最小值,再从这些最小值中拿出最大值。求这个最大值最大能为多少?Input第一行输入两个整数n和k(1 ≤ k ≤ n ≤ 105) — 数组a的大小和要求分成子段的数目第二行包含n整数a1, a2, ..., ...原创 2019-08-18 17:14:55 · 789 阅读 · 0 评论 -
Alex的午饭
题源单点时限:3.0 sec内存限制:64 MBSteve和Alex每天都在为午饭吃什么而发愁,因为吃的东西实在是太多了,而且很多都特别好吃。为了解决吃什么的问题,Alex决定每次吃饭前发布一个问卷调查,让他的好朋友选出他们今天最想吃的食物,然后Alex会根据问卷的结果来确定吃什么每个问卷只收集一种食物,每个食物都由一个数字num来表示。Alex会选出问卷中出现次数超过问卷总数...原创 2019-08-18 17:31:11 · 144 阅读 · 0 评论 -
Borya's Diagnosis
题目链接Hao得了重感冒。他将要去看n名医生来找出确切的诊断。每个医生都需要之前医生的所有的诊断信息,所以Hao需要按照规定的顺序访问医生(比如Hao应该先访问1号医生,2号医生, 然后是3号医生,等等)。 Hao将从上一位医生那里获取关于他的健康信息。医生有一个奇怪的工作表。第i名医生从si天起工作之后会每隔di天再工作.所以医生在si, si + di, si + 2di, ....原创 2019-08-18 21:23:43 · 169 阅读 · 0 评论 -
差异的可分割性
题目链接现在有n个整数,在这n个数中找出k个数,保证这k个数中任意两个数差的绝对值可以被m整除。Input第一行输入三个整数n,k,m(2<=k<=n<=100000,1<=m<=100000)。第二行包含n个整数a1,a2,..., an(0 <= ai <= 10^9 )。Output如果不存在这样的k个数,输出"No";...原创 2019-08-19 10:14:07 · 180 阅读 · 0 评论 -
Magical Bamboos
题目链接In a magical forest, there existsNbamboos that don't quite get cut down the way you would expect.Originally, the height of theithbamboo is equal tohi. In one move, you can push down a bam...原创 2019-08-21 21:29:41 · 380 阅读 · 0 评论 -
Steve的水池
题目链接单点时限:1.0 sec内存限制:512 MBSteve拥有深棕色头发,晒黑的褐色皮肤,紫色的眼睛,身穿青蓝色的衬衫,一条紫蓝色牛仔裤以及灰黑色的鞋子。他还拥有2px至4px大小的胳膊。Steve似乎拥有轻微的浅棕色胡子茬,或者拥有一张嘴,这取决于你怎样看他。Steve需要种庄稼,圈养动物来获得食物来源,为了抵抗怪物,他需要挖矿获得铁锭,金锭,甚至钻石来制作更高级...原创 2019-08-17 18:56:22 · 163 阅读 · 0 评论 -
Steve的游戏名
题目链接单点时限:1.0 sec内存限制:128 MB定义一个字符串s是一步字符串,当s满足以下两个条件:s中仅包含小写字母。 对于任意的1≤i<|s|满足,s[i]+1=s[i+1],也就是说,s[i]在英文字母表中的位置的下一位是s[i+1],特别的,我们认为z的下一位是a,其中|s|表示s的长度。举个例子:abc、zab都是一步字符串,而acd、zbc...原创 2019-08-17 21:30:24 · 692 阅读 · 0 评论 -
1003 我要通过!
传送门1003我要通过!(20分)“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于 PAT 的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。得到“答案正确”的条件是:字符串中必须仅有P、A、T这三种字符,不可以包含其它字符; 任意形如xPATx的字符串都可以获得“答案正确”,其中x或者是空字符串...原创 2019-09-04 10:31:49 · 118 阅读 · 0 评论 -
Perfect Team
传送门You may have already known that a standard ICPC team consists of exactly three members. The perfect team however has more restrictions. A student can have some specialization: coder or mathematic...原创 2019-09-21 17:00:46 · 424 阅读 · 0 评论 -
Game of Credit Cards(田忌赛马)
传送门After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.Rules of ...原创 2019-09-23 21:01:42 · 237 阅读 · 0 评论 -
搜索漂亮的整数
题目链接小红现在有两个列表的数字.如果一个十进制数至少有一个数字来自列表一且至少有一个数字来自列表二,那么将这个数字叫做小红数,请你找出最小的正小红数Input第一行包括两个整数n和m(1 ≤ n, m ≤ 9) — 分别代表第一个和第二个列表的长度。第二行包含n个不同的数字a1, a2, ..., an(1 ≤ ai ≤ 9) 代表列表一中的元素。第三行包...原创 2019-08-18 16:58:52 · 182 阅读 · 0 评论