随笔分类 -  OJ-codeforces

摘要:C 问删掉在数组中一个数后,剩下的数组中,是否存在一个数时其它所有数的和。 遍历每一个数,假设删掉它后,剩下的数中取一个最大值,看他的值是不是数组之和的一半,是的话就成立。 D 有一个数组,可以选定一个子集,看最大能删除多少次,输出那个子集。 二分,检查当前最大删除次数时m时,是否成立。 E 有很多 阅读全文
posted @ 2018-11-17 12:00 starry_sky 阅读(224) 评论(0) 推荐(0)
摘要:C 有n个节点和m边条,求一条最长的路径,该路径(c1,c2,c3...cn)满足 不出现重复的节点,ci 和ci+1是邻居节点,且 ci 的邻居节点数量小于ci+1的邻居节点数量。 记忆DFS遍历,每次递归计算的值都保存在数组里,这样复杂度相当于O(m) 1 #include <bits/stdc 阅读全文
posted @ 2018-11-08 22:20 starry_sky 阅读(272) 评论(0) 推荐(0)
摘要:http://codeforces.com/contest/1070 A 给你一个d和s,求一个最小的数,使的能整除d,并且每位数的和为s。 如果确定了某n位数取模d的值,那么再计算同样的n位数,取模d也是相同的值时,就多此一举了。比如10%2 == 0 20%2 == 0 同样是两位数,取模2都是 阅读全文
posted @ 2018-10-23 18:13 starry_sky 阅读(470) 评论(0) 推荐(0)
摘要:A. Packets A. Packets You have nn coins, each of the same value of 11. Distribute them into packets such that any amount xx (1≤x≤n1≤x≤n) can be formed 阅读全文
posted @ 2018-09-04 21:11 starry_sky 阅读(199) 评论(0) 推荐(0)
摘要:A. Palindromic Twist A. Palindromic Twist You are given a string ss consisting of nn lowercase Latin letters. nn is even. For each position ii (1≤i≤n1 阅读全文
posted @ 2018-08-19 16:16 starry_sky 阅读(386) 评论(0) 推荐(0)
摘要:A. Single Wildcard Pattern Matching A. Single Wildcard Pattern Matching You are given two strings ss and tt. The string ss consists of lowercase Latin 阅读全文
posted @ 2018-08-18 09:34 starry_sky 阅读(410) 评论(0) 推荐(0)
摘要:A. The Rank A. The Rank John Smith knows that his son, Thomas Smith, is among the best students in his class and even in his school. After the student 阅读全文
posted @ 2018-08-11 19:30 starry_sky 阅读(317) 评论(0) 推荐(0)
摘要:A. Death Note A. Death Note You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the l 阅读全文
posted @ 2018-08-05 10:44 starry_sky 阅读(440) 评论(0) 推荐(0)
摘要:A. Points in Segments time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Points in Segmen 阅读全文
posted @ 2018-08-04 17:27 starry_sky 阅读(632) 评论(0) 推荐(0)
摘要:A 签到 奇数不变,偶数减一 B. Polycarp's Practice n个数,去k个区间,是的区间的最大值之和最大。 直接去最大的k个数就行。 C. Three Parts of the Array n个数,划分为三个区间,可以为空,求第一个区间之和与第三区间之和相同时,最大值是多少。 1至n 阅读全文
posted @ 2018-07-19 21:07 starry_sky 阅读(336) 评论(0) 推荐(0)
摘要:A. Romaji A. Romaji Vitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are "a", "o" 阅读全文
posted @ 2018-07-14 10:22 starry_sky 阅读(352) 评论(0) 推荐(0)
摘要:A. Sonya and Hotels A. Sonya and Hotels Sonya decided that having her own hotel business is the best way of earning money because she can profit and r 阅读全文
posted @ 2018-07-13 14:24 starry_sky 阅读(345) 评论(0) 推荐(0)
摘要:A. Tanya and Stairways A. Tanya and Stairways Little girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, 阅读全文
posted @ 2018-07-10 18:54 starry_sky 阅读(639) 评论(0) 推荐(0)
摘要:A 签到题 求出现次数最多的数的次数。 B. Binary String Constructing B. Binary String Constructing You are given three integers aa, bb and xx. Your task is to construct 阅读全文
posted @ 2018-07-04 00:54 starry_sky 阅读(470) 评论(0) 推荐(0)
摘要:A. Balloons A. Balloons There are quite a lot of ways to have fun with inflatable balloons. For example, you can fill them with water and see what hap 阅读全文
posted @ 2018-07-02 13:07 starry_sky 阅读(557) 评论(0) 推荐(0)
摘要:A. Nastya and an Array A. Nastya and an Array Nastya owns too many arrays now, so she wants to delete the least important of them. However, she discov 阅读全文
posted @ 2018-06-21 18:30 starry_sky 阅读(291) 评论(0) 推荐(0)
摘要:C. Equal Sums C. Equal Sums You are given kk sequences of integers. The length of the ii-th sequence equals to nini. You have to choose exactly two se 阅读全文
posted @ 2018-06-02 10:22 starry_sky 阅读(587) 评论(0) 推荐(0)
摘要:C. Three displays C. Three displays It is the middle of 2018 and Maria Stepanovna, who lives outside Krasnokamensk (a town in Zabaikalsky region), wan 阅读全文
posted @ 2018-05-30 22:12 starry_sky 阅读(320) 评论(0) 推荐(0)
摘要:A. Remove Duplicates Petya has an array aa consisting of nn integers. He wants to remove duplicate (equal) elements. Petya wants to leave only the rig 阅读全文
posted @ 2018-05-13 20:08 starry_sky 阅读(831) 评论(0) 推荐(0)
摘要:A. Aramic script In Aramic language words can only represent objects. Words in Aramic have special properties: A word is a root if it does not contain 阅读全文
posted @ 2018-05-13 12:18 starry_sky 阅读(361) 评论(0) 推荐(0)