文章分类 - JOJ
2746 Problem F: Actualist - 离散化
摘要:题意:区间染色,求染色次数大于等于k的长度。思路:因为n的范围比较小,直接离散化。----经典好题!!题目链接:http://acm.jlu.edu.cn/joj/showproblem.php?pid=2746例:View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <string> 5 #include <algorithm> 6 #include <iostream> 7 #include <map>
阅读全文
2680 Problem F: Coin Game
摘要:题意:给出两个序列a[],b[],第一个递减,第二个随机,问怎样交换第二个序列(每次相邻两个互换),使得第二个序列每个位置上的数都小于等于第一个序列。例:sample input:33 2 12 2 133 2 11 2 346 5 3 11 3 5 5sample output:035思路:a,b都从最后开始遍历,若a[i]<b[i],则将b[i]移到a[i]后面,否则标记b[i]。View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <
阅读全文
2682 Problem H: New Feature in Windows 7
摘要:题意:给出n个字符串,按要求排序,要求如下:Iftwo filenames are same before certain position including start, theorder should be decided by these conditions:a) If both of them are alphabets, the result depends on the alphabet order.b) If one is alphabet and the other is number, the number is smaller.c) If both of them ar
阅读全文
浙公网安备 33010602011771号