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 |

Language: Crazy Thairs
Description These days, Sempr is crazed on one problem named Crazy Thair. Given 1. 1 ≤ A < _{j}A < _{k}A < _{l}A _{m}For example, in the sequence {2, 1, 3, 4, 5, 7, 6},there are four Crazy Thair groups: {1, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {1, 3, 4, 5, 7} and {2, 3, 4, 5, 7}. Could you help Sempr to count how many Crazy Thairs in the sequence? Input Input contains several test cases. Each test case begins with a line containing a number Output Output the amount of Crazy Thairs in each sequence. Sample Input 5 1 2 3 4 5 7 2 1 3 4 5 7 6 7 1 2 3 4 5 6 7 Sample Output 1 4 21 Source POJ Monthly--2007.09.09, tdzl2003 |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator