ABCDEF - ABCDEF
You are given a set S of integers between -30000 and 30000 (inclusive).
Find the total number of sextuples that satisfy:
Input
The first line contains integer N (1 ≤ N ≤ 100), the size of a set S.
Elements of S are given in the next N lines, one integer per line. Given numbers will be distinct.
Output
Output the total number of plausible sextuples.
Examples
Input: 1 1 Output: 1 |
Input: 2 2 3 Output: 4 |
Input: 2 -1 1 Output: 24 |
Input: 3 5 7 10 Output: 10 |
hide comments
sirius:
2015-01-05 14:36:08
Im getting time limit exceeded for case 11,anyone knows why? |
|
Vinay:
2014-12-13 18:56:04
used quick sort and binary search still got TLE for 11th case :/ |
|
HARINDER SINGH:
2014-11-22 17:06:17
used map got TLE
|
|
Lokesh:
2014-11-09 07:04:39
What is the best possible time complexity?(Say we have to find in the range 1-n) |
|
Ashish Tilokani:
2014-11-07 19:57:36
wtf?? long long gives TLE ?? |
|
Make In India !:
2014-11-06 21:24:13
Note : 'd' can't be Zero . Gave me WA in 14th test case. |
|
californiagurl:
2014-11-03 11:06:38
if you dont understand how to approach this problem, just read all the comments :p ;) :D Last edit: 2014-11-03 11:44:10 |
|
Arun Karthikeyan:
2014-10-26 16:31:46
phew!!, took an entire day to get a good timed java solution
|
|
Anubhav Balodhi :
2014-10-23 09:53:58
got TLE using STL, why :-P |
|
jack sparrow:
2014-09-24 13:47:23
easy!!! if u do it properly ,even with stl |
Added by: | Luka Kalinovcic |
Date: | 2009-07-13 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ERL JS-RHINO NODEJS PERL6 VB.NET |
Resource: | own problem |