我们有这样一个文件 首先我们的思路是把输入文件数据转化成键值对的形式进行比较不就好了嘛! 但是你要明白这一点,我们平时所使用的键值对是不具有比较意义的,也就说他们没法拿来直接比较。 我们可以通过sortByKey,sortBy(pair._2)来进行单列的排序,但是没法进行两列的同时排序。 那么我们 ...
分类:
编程语言 时间:
2018-05-15 00:25:44
阅读次数:
240
//SGU 131 还没完全想清楚 留坑 SGU 259 题意:一个机器处理n个任务,每个任务有时间t和传送时间l 收获:贪心 #include<bits/stdc++.h> #define de(x) cout<<#x<<"="<<x<<endl; #define dd(x) cout<<#x<< ...
分类:
其他好文 时间:
2018-05-14 22:09:15
阅读次数:
217
D. String D. String You are given a string s. Each pair of numbers l and r that fulfill the condition 1?≤?l?≤?r?≤?|s|, correspond to a substring of th ...
分类:
编程语言 时间:
2018-05-13 19:03:40
阅读次数:
220
题解:贪心,先处理人数多的组,把符合条件(能装下整个队伍的地点)的丢到优先队列里(保证没有遗漏可能的解)。然后遍历每个组时取队列里的最小值就可以了。 ...
分类:
其他好文 时间:
2018-05-12 23:53:35
阅读次数:
203
TEXT 5 Stuff of dreams 梦想的精粹 Feb 16th 2006 | CORK AND LONDON From The Economist print edition (译者注:本文是关于画展的评论。) Two exhibitions show how a pair of 18t ...
分类:
其他好文 时间:
2018-05-10 20:23:55
阅读次数:
149
POJ_1269_Intersecting Lines_求直线交点 Description We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane ...
分类:
其他好文 时间:
2018-05-10 11:33:21
阅读次数:
129
题目链接 "BZOJ" 题解 "orz" C++ include include include include include include define LL long long int define Redge(u) for (int k = h[u],to; k; k = ed[k].nx ...
分类:
其他好文 时间:
2018-05-09 20:54:12
阅读次数:
149
問題文N 個の都市があり、K 本の道路と L 本の鉄道が都市の間に伸びています。 i 番目の道路は pi 番目と qi 番目の都市を双方向に結び、 i 番目の鉄道は ri 番目と si 番目の都市を双方向に結びます。 異なる道路が同じ 2 つの都市を結ぶことはありません。同様に、異なる鉄道が同じ 2 ...
分类:
其他好文 时间:
2018-05-09 19:32:47
阅读次数:
180
Problem Description There are a group of students. Some of them may know each other, while others don't. For example, A and B know each other, B and C ...
分类:
其他好文 时间:
2018-05-08 14:44:39
阅读次数:
177
三台centos 一台服务器192.168.2.152 一台客户端192.168.2.142 一台客户端192.168.2.151(1)产生无密钥 [root@localhost ~]# ssh-keygen -t dsaGenerating public/private dsa key pair. ...
分类:
其他好文 时间:
2018-05-07 13:43:25
阅读次数:
136