随笔分类 - 其他
摘要:题目描述 一个等差数列是一个能表示成a, a+b, a+2b,..., a+nb (n=0,1,2,3,...)的数列。 在这个问题中a是一个非负的整数,b是正整数。写一个程序来找出在双平方数集合(双平方数集合是所有能表示成p的平方 + q的平方的数的集合,其中p和q为非负整数)S中长度为n的等差数
阅读全文
摘要:题目描述 Farmer John's arch-nemesis, Farmer Paul, has decided to sabotage Farmer John's milking equipment! The milking equipment consists of a row of N (3
阅读全文
摘要:DZY loves collecting special strings which only contain lowercase letters. For each lowercase letter c DZY knows its value wc. For each special string
阅读全文
摘要:DZY has a hash table with p buckets, numbered from 0 to p - 1. He wants to insert n numbers, in the order they are given, into the hash table. For the
阅读全文
摘要:Jeff got 2n real numbers a1, a2, ..., a2n as a birthday present. The boy hates non-integer numbers, so he decided to slightly "adjust" the numbers he'
阅读全文
摘要:One day Jeff got hold of an integer sequence a1, a2, ..., an of length n. The boy immediately decided to analyze the sequence. For that, he needs to f
阅读全文
摘要:Jeff's got n cards, each card contains either digit 0, or digit 5. Jeff can choose several cards and put them in a line so that he gets some number. W
阅读全文
摘要:Lucky Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1443 Accepted Submission(s): 767 Problem De
阅读全文
摘要:You are given a non-empty string s consisting of lowercase English letters. You have to pick exactly one non-empty substring of s and shift all its le
阅读全文
摘要:Vasya takes part in the orienteering competition. There are n checkpoints located along the line at coordinates x1, x2, ..., xn. Vasya starts at the p
阅读全文
摘要:Kolya is going to make fresh orange juice. He has n oranges of sizes a1, a2, ..., an. Kolya will put them in the juicer in the fixed order, starting w
阅读全文
摘要:Since Grisha behaved well last year, at New Year's Eve he was visited by Ded Moroz who brought an enormous bag of gifts with him! The bag contains n s
阅读全文
摘要:A. Tricky Alchemy time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output During the winter holid
阅读全文
摘要:题目描述 给定平面上n个点,找出其中的一对点的距离,使得在这n个点的所有点对中,该距离为所有点对中最小的 输入输出格式 输入格式: 第一行:n;2≤n≤200000 接下来n行:每行两个实数:x y,表示一个点的行坐标和列坐标,中间用一个空格隔开。 输出格式: 仅一行,一个实数,表示最短距离,精确到
阅读全文
摘要:https://lutece.xyz/contest/detail/10/ 题目很简单,套路题; 求n个数中选k个数使得gcd最大; 很容易想到,我们只需要将因子分解出来然后计数即可; (只是这个idea和一道oj的题目重了,实在不好意思);
阅读全文
摘要:题目描述 有n 个连续函数fi (x),其中1 ≤ i ≤ n。对于任何两个函数fi (x) 和fj (x),(i != j),恰好存在一个x 使得fi (x) = fj (x),并且存在无穷多的x 使得fi (x) < fj (x)。对于任何i; j; k,满足1 ≤ i < j < k ≤ n,
阅读全文
摘要:One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive inte
阅读全文
摘要:Many students live in a dormitory. A dormitory is a whole new world of funny amusements and possibilities but it does have its drawbacks. There is onl
阅读全文
摘要:Little Boxes Problem Description Little boxes on the hillside.Little boxes made of ticky-tacky.Little boxes.Little boxes.Little boxes all the same.The
阅读全文
摘要:题目描述 草原上住着一群小松鼠,每个小松鼠都有一个家。时间长了,大家觉得应该聚一聚。但是草原非常大,松鼠们都很头疼应该在谁家聚会才最合理。 每个小松鼠的家可以用一个点x,y表示,两个点的距离定义为点(x,y)和它周围的8个点(x-1,y)(x+1,y),(x,y-1),(x,y+1).(x-1,y+
阅读全文