Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:TLE了,哪位仁兄帮帮我看一下:In Reply To:TLE了,哪位仁兄帮帮我看一下: Posted by:zhb_msqx at 2007-09-18 17:18:03 you can using int[1000000] array to hold the team information. for input 2 3 101 102 103 3 201 202 203 then a[101] = 1; a[102] = 1; a[103] = 1; a[201] = 2, a[202] = 2; a[203] = 2; Then you can follow the queue to simulate. List<List> hold the queue. when find the team, you only need to compare the value between, team[coming value] == list.get(j).get(0); the rest is very simple. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator