题目链接:poj 3067 Japan
题目大意:给定N和M,表示东部和西部城市的数量,然后K条铁路,每条铁路连接东西城市,问说会有多少次交点。
解题思路:线段树维护即可,每条边按照x小的,y小的排序,然后每次查询y+1到M的即可。
#include
#include
#include
using namespace std;
const int maxn = 1005;...
分类:
其他好文 时间:
2014-10-24 00:21:42
阅读次数:
235
Problem Description
Hatsune Miku is a popular virtual singer. It is very popular in both Japan and China. Basically it is a computer software that allows you to compose a song on your own using the...
分类:
其他好文 时间:
2014-10-23 17:38:28
阅读次数:
159
Hatsune Miku
Problem Description
Hatsune Miku is a popular virtual singer. It is very popular in both Japan and China. Basically it is a computer software that allows you to compose a song on yo...
分类:
其他好文 时间:
2014-10-23 10:40:49
阅读次数:
384
题目大意:有两排城市,这两排城市之间有一些路相互连接着,求有多少条路相互交叉。
思路:把所有的路先按照x值从小到大排序,x值相同的按照y值从小到大排序,然后插入边的时候,先找有多少比自己y值小的,这些边的x值一定比自己大,也就是一个逆序对,然后统计起来。记得答案要用long long (__int64)
CODE:
#include
#include
#inclu...
分类:
编程语言 时间:
2014-10-16 11:30:12
阅读次数:
218
Tunnel Warfare
Time Limit: 1000MS
Memory Limit: 131072K
Total Submissions: 6972
Accepted: 2864
Description
During the War of Resistance Against Japan, tunnel warfare ...
分类:
其他好文 时间:
2014-08-29 11:10:47
阅读次数:
162
Description
Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <= ...
分类:
其他好文 时间:
2014-08-24 23:54:53
阅读次数:
263
Description
The rail roads of Japan are being redesigned. So the governent is planning to install ultra-modern Magnetic trains instead of the current
normal trains. As fuel price have gone hi...
分类:
Web程序 时间:
2014-08-22 12:57:18
阅读次数:
401
Most Distant Point from the Sea
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 3955
Accepted: 1847
Special Judge
Description
The main land of Japan ca...
分类:
其他好文 时间:
2014-08-20 22:48:43
阅读次数:
418
我的中文系统,把对应非unicode字符时的设置,改成了 日文, 结果控制台使用sqlplus时候,总是出现乱码。解决方法是,把NLS_LANG环境变量变成跟系统一样,就可以了。american_america.zhs16gbk =>JAPANESE_JAPAN.JA16SJIS(使用 JA16SJ...
分类:
数据库 时间:
2014-08-18 15:49:32
阅读次数:
355
总结一下树状数组的题目:{POJ}{3928}{Ping Pong}非常好的题目,要求寻找一个数组中满足A[i]0。{POJ}{3067}{Japan}顺序给两组平行的点依次编号1~N和1~M,给定K个线段在两组点之间,求相交(cross)的线段对有多少个,同一个起点或终点不算相交。由于题目涉及到统...
分类:
其他好文 时间:
2014-08-15 22:20:19
阅读次数:
252