---- 贪心----
nobleman__
加油王先生
展开
-
Codeforce - 872 - B. Maximum of Maximums of Minimums【思维+贪心】
B. Maximum of Maximums of Minimumstime limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputYou are given an array a1, a2, …, an consisting of n integer原创 2017-10-19 21:37:30 · 1432 阅读 · 0 评论 -
codeforces779 C. Dishonest Sellers【贪心】
C. Dishonest Sellerstime limit per test2 seconds memory limit per test256 megabytesIgor found out discounts in a shop and decided to buy n items. Discounts at the store will last for a week and I原创 2018-01-29 22:26:44 · 462 阅读 · 0 评论 -
codeforces489 C. Given Length and Sum of Digits...【贪心】
C. Given Length and Sum of Digits…time limit per test1 second memory limit per test256 megabytesYou have a positive integer m and a non-negative integer s. Your task is to find the smallest and t...原创 2018-02-10 22:52:47 · 365 阅读 · 0 评论 -
codeforces478 B. Random Teams【贪心】
B. Random Teamstime limit per test1 second memory limit per test256 megabytesn participants of the competition were split into m teams in some manner so that each team has at least one participan...原创 2018-02-10 23:01:37 · 311 阅读 · 0 评论 -
codeforces478 C. Table Decorations【贪心】
C. Table Decorationstime limit per test1 second memory limit per test256 megabytesYou have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three ba...原创 2018-02-10 23:09:47 · 438 阅读 · 0 评论 -
codeforces918C 917A The Monster 【贪心 + 思维枚举】
C. The Monstertime limit per test1 second memory limit per test256 megabytesAs Will is stuck in the Upside Down, he can still communicate with his mom, Joyce, through the Christmas lights (he can原创 2018-01-30 12:52:52 · 1506 阅读 · 2 评论 -
POJ 3190 Stall Reservations【贪心 + 优先队列】
Stall ReservationsTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 8936 Accepted: 3129 Special JudgeDescriptionOh those picky N (1 <= N <= 50,000) cows! They are s...原创 2018-02-27 01:57:38 · 296 阅读 · 0 评论 -
蓝桥杯 算法提高 最大乘积 【贪心】
算法提高 最大乘积 时间限制:1.0s 内存限制:512.0MB 问题描述 对于n个数,从中取出m个数,如何取使得这m个数的乘积最大呢?输入格式 第一行一个数表示数据组数 每组输入数据共2行: 第1行给出总共的数字的个数n和要取的数的个数m,1<=n<=m<=15, 第2行依次给出这n个数,其中每个数字的范围满足:a[i]的绝对值...原创 2018-02-27 23:11:24 · 1450 阅读 · 0 评论 -
蓝桥杯 算法提高 打水问题 【简单贪心】
算法提高 打水问题 时间限制:1.0s 内存限制:512.0MB 问题描述 N个人要打水,有M个水龙头,第i个人打水所需时间为Ti,请安排一个合理的方案使得所有人的等待时间之和尽量小。输入格式 第一行两个正整数N M 接下来一行N个正整数Ti。 N,M<=1000,Ti<=1000输出格式 最小的等待时间之和。(不需要输出具体的...原创 2018-02-22 12:59:54 · 1709 阅读 · 0 评论 -
codeforces950 C. Zebras【贪心】
C. Zebrastime limit per test1 second memory limit per test512 megabytesOleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty seq...原创 2018-03-10 09:12:56 · 824 阅读 · 0 评论 -
codeforces940 C. Phone Numbers【贪心】
C. Phone Numberstime limit per test2 seconds memory limit per test256 megabytes And where the are the phone numbers?You are given a string s consisting of lowercase English letters and an intege...原创 2018-02-24 23:19:52 · 1310 阅读 · 0 评论 -
codeforces940B. Our Tanya is Crying Out Loud【贪心】
B. Our Tanya is Crying Out Loudtime limit per test1 second memory limit per test256 megabytesRight now she actually isn’t. But she will be, if you don’t solve this problem.You are given integer...原创 2018-02-24 23:36:49 · 1155 阅读 · 0 评论 -
codeforces 383 A. Milking cows【贪心 + 前缀和】
A. Milking cowstime limit per test1 second memory limit per test256 megabytesIahub helps his grandfather at the farm. Today he must milk the cows. There are n cows sitting in a row, numbered from...原创 2018-03-19 22:05:35 · 538 阅读 · 0 评论 -
codeforces389 E. Fox and Card Game【博弈 + 贪心】
E. Fox and Card Gametime limit per test1 second memory limit per test256 megabytesFox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a...原创 2018-03-21 19:47:10 · 520 阅读 · 0 评论 -
codeforces389 C. Fox and Box Accumulation【简单贪心】
C. Fox and Box Accumulationtime limit per test1 second memory limit per test256 megabytesFox Ciel has n boxes in her room. They have the same size and weight, but they might have different streng...原创 2018-03-21 21:29:08 · 371 阅读 · 0 评论 -
Codeforces Round #486 (Div. 3) E. Divisibility by 25【贪心】【模拟】
E. Divisibility by 25time limit per test1 secondmemory limit per test256 megabytesYou are given an integer n from 1 to 1018 without leading zeroes.In one move you can swap any two adjacent digits ...原创 2019-01-27 22:24:23 · 273 阅读 · 0 评论 -
codeforces 810 B. Summer sell-off【贪心】
B. Summer sell-offtime limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputSummer holidays! Someone is going on trips, someone is visiting grandpa原创 2018-01-25 18:40:38 · 342 阅读 · 0 评论 -
codeforces 913 C. Party Lemonade【思维贪心】
C. Party Lemonadetime limit per test1 second memory limit per test256 megabytesA New Year party is not a New Year party without lemonade! As usual, you are expecting a lot of guests, and buying lemona原创 2018-01-09 10:55:33 · 1837 阅读 · 0 评论 -
hiho一下 第175周 - Robots Crossing River 【贪心】
题目1 : Robots Crossing River时间限制:10000ms 单点时限:1000ms 内存限制:256MB描述Three kinds of robots want to move from Location A to Location B and then from Location B to Location C by boat.The only one boat betwe原创 2017-11-08 21:53:20 · 299 阅读 · 0 评论 -
51NOD - 贪心算法入门 - 活动安排问题 【简单贪心】
题目有若干个活动,第i个开始时间和结束时间是[Si,fi),只有一个教室,活动之间不能交叠,求最多安排多少个活动?输入第1行:1个数N,线段的数量(2 <= N <= 10000) 第2 - N + 1行:每行2个数,线段的起点和终点(-10^9 <= S,E <= 10^9)输出输出最多可以选择的线段数量。输入示例3 1 5 2 3 3 6输出示例2题意: 略分析: 很轻易就能看出来不能根原创 2017-11-20 20:34:00 · 471 阅读 · 0 评论 -
51NOD - 贪心算法入门 - 活动安排问题 之 二【简单贪心 + 思维】
题目有若干个活动,第i个开始时间和结束时间是[Si,fi),活动之间不能交叠,要把活动都安排完,至少需要几个教室?输入第一行一个正整数n (n <= 10000)代表活动的个数。 第二行到第(n + 1)行包含n个开始时间和结束时间。 开始时间严格小于结束时间,并且时间都是非负整数,小于1000000000输出一行包含一个整数表示最少教室的个数。输入示例3 1 2 3 4 2 9输出示例2原创 2017-11-20 20:41:00 · 510 阅读 · 0 评论 -
51NOD - 贪心算法入门 - 独木舟问题 【简单贪心】
题目n个人,已知每个人体重,独木舟承重固定,每只独木舟最多坐两个人,可以坐一个人或者两个人。显然要求总重量不超过独木舟承重,假设每个人体重也不超过独木舟承重,问最少需要几只独木舟?输入第一行包含两个正整数n (0输出一行一个整数表示最少需要的独木舟数。输入示例3 6 1 2 3输出示例2题意: 略分析: 排序后,直接一个船配一个重的和一个轻的,不行的话就直接重的自己一个船参考代码#includ原创 2017-11-20 20:59:57 · 1260 阅读 · 0 评论 -
HDU 1789 Doing Homework again【贪心】
Doing Homework againTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 15536 Accepted Submission(s): 9064Problem DescriptionIgnatius has just c原创 2017-11-30 10:37:15 · 294 阅读 · 0 评论 -
HDU 4310 Hero【贪心】
HeroTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 6757 Accepted Submission(s): 2852Problem DescriptionWhen playing DotA with god-like riva原创 2017-11-30 10:48:02 · 388 阅读 · 0 评论 -
codeforces 873 C. Strange Game On Matrix【贪心】
C. Strange Game On Matrixtime limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Ivan is playing a strange game.He has a matrix a with n rows and m原创 2017-12-01 16:16:40 · 436 阅读 · 0 评论 -
POJ 1700 Crossing River 【经典贪心】
Crossing RiverTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 16936 Accepted: 6407DescriptionA group of N people wishes to go across a river with only one boat, which can at mos原创 2017-12-01 16:28:05 · 337 阅读 · 0 评论 -
POJ - 2376 Cleaning Shifts【哈希一下】
Cleaning ShiftsTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 25403 Accepted: 6299 DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleanin原创 2017-12-01 16:39:03 · 303 阅读 · 0 评论 -
codeforces - 870problem - C. Maximum splitting【贪心】
C. Maximum splittingtime limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard outputYou are given several queries. In the i-th query you are given a single p原创 2017-10-21 09:52:41 · 1144 阅读 · 0 评论 -
蓝桥杯 基础练习 完美的代价 【贪心 + string】
基础练习 完美的代价 时间限制:1.0s 内存限制:512.0MB问题描述 回文串,是一种特殊的字符串,它从左往右读和从右往左读是一样的。小龙龙认为回文串才是完美的。现在给你一个串,它不一定是回文的,请你计算最少的交换次数使得该串变成一个完美的回文串。 交换的定义是:交换两个相邻的字符 例如mamad 第一次交换 ad : mamda 第二次交换 m...原创 2017-12-21 09:25:44 · 814 阅读 · 0 评论 -
2017年西南民族大学程序设计竞赛-网络同步赛 C 装进肚子【贪心】
C 装进肚子题目描述自从ZZZZone吃完糖果后,他开始改吃巧克力了,他每天想吃n个巧克力增在甜蜜值,他决定早上吃K个巧克力,晚上吃n - K个巧克力,每个巧克力在早上吃和在晚上吃的甜蜜值是不一样的,他想让自己得到的甜蜜值最大,并想知道最大是多少。 请你编程帮助他。输入描述:第一行包含两个数n,K表示每天要吃的巧克力数量和要在早上吃的数量。(n <= 100000, K <= n) 第二行包含原创 2017-12-30 18:53:54 · 778 阅读 · 0 评论 -
codeforces 898 D. Alarm Clock【贪心 + 模拟】
D. Alarm Clocktime limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard outputEvery evening Vitalya sets n alarm clocks to wake up tomorrow. Every alarm cloc原创 2017-12-18 11:57:17 · 1371 阅读 · 0 评论 -
AtCoder Beginner Contest 085 D - Katana Thrower【贪心】
AtCoder Beginner Contest 085 D - Katana ThrowerTime limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem StatementYou are going out for a walk, when you suddenly encounter a monster. F原创 2018-01-08 10:27:32 · 621 阅读 · 0 评论 -
codeforces 913 C Party Lemonade 【思维贪心】
C. Party Lemonadetime limit per test1 second memory limit per test256 megabytesA New Year party is not a New Year party without lemonade! As usual, you are expecting a lot of guests, and buying l原创 2019-11-07 15:06:24 · 253 阅读 · 0 评论 -
全国統一プログラミング王決定戦予選/NIKKEI Programming Contest 2019 Announcement C - Different Strokes【贪心】
C - Different StrokesTime limit : 2sec / Memory limit : 1024MBScore : 400 pointsProblem StatementThere are N dishes of cuisine placed in front of Takahashi and Aoki. For convenience, we call these...原创 2019-01-27 22:37:10 · 408 阅读 · 0 评论