Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

一点感想

Posted by t9thkid at 2006-08-30 01:13:21 on Problem 1731
这是一个求全排列的问题,数组有重复元素。
求全排列有很多种方法,如递归、DFS等,但此题使用STL泛型函数十分简单。
核心代码如下:
gets(s);
sort(s);
while(1) 
{   
    puts(s); 
    if(!next_permutation(s,strlen(s)))  break; 
} 

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator