今日头条2017校招编程题
摘要:贪心?瞎搞 先排个序,然后扫一遍,边扫边维护一个数组v v的长度为3 设vs数组的最后一个是x 如果abs(a[i]-x)大于10 那么贪心的策略我就 添加个v+10相应的ans++. 如果v数组的长度到达3了,就清空v数组。 然后注意一些细节就好了... 我代码写的好挫
阅读全文
posted @
2016-09-21 21:00
Beserious
阅读(1247)
推荐(0) 编辑
Codeforces Round #142 (Div. 2)B. T-primes
摘要:B. T-primes time limit per test 2 seconds time limit per test memory limit per test 256 megabytes memory limit per test input standard input input out
阅读全文
posted @
2016-09-08 17:48
Beserious
阅读(474)
推荐(0) 编辑
SPOJ XMAX - XOR Maximization
摘要:XMAX - XOR Maximization Given a set of integers S = { a1, a2, a3, ... a|S| }, we define a function X on S as follows:X( S ) = a1 ^ a2 ^ a3 ^ ... ^ a|S
阅读全文
posted @
2016-09-08 16:42
Beserious
阅读(468)
推荐(0) 编辑
Uva 10036 - Divisibility
摘要:Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expr
阅读全文
posted @
2016-09-06 15:55
Beserious
阅读(384)
推荐(0) 编辑
Timus 1009. K-based Numbers
摘要:1009. K-based Numbers Time limit: 0.5 secondMemory limit: 64 MB Let’s consider K-based numbers, containing exactly N digits. We define a number to be
阅读全文
posted @
2016-09-06 15:14
Beserious
阅读(397)
推荐(0) 编辑
MBLAST - BLAST
摘要:There are given two strings, A and B. An expansion of some string X is a string created by adding or inserting any number (zero, one or more) of blank
阅读全文
posted @
2016-09-05 02:25
Beserious
阅读(321)
推荐(0) 编辑
ROADS - Roads
摘要:N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it: the road length and the toll th
阅读全文
posted @
2016-09-05 02:19
Beserious
阅读(450)
推荐(0) 编辑