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
avik26091998:
2017-12-01 09:12:37
lower_bound and upper-bound !!! |
|
trijeet:
2017-10-29 23:48:44
Beware d can't be zero ! ac in 2nd go :) |
|
aditya930:
2017-09-23 18:50:38
Nice one..lower bound and upper bound will help O(n^3) is acceptable.
|
|
pk201996:
2017-08-25 22:00:10
nice problem use unordered_map stl |
|
aronzx:
2017-08-22 11:20:37
Hint: Use only one unordered_map. |
|
zzuwenjie:
2017-08-19 03:48:06
use sort, AC in one go, O(3*(N^3)*logN) , but I don't know how to use hash. |
|
hahaha42:
2017-07-07 15:38:21
use hash, AC in one go |
|
deepu_2095:
2017-06-20 12:48:13
can anyone explain the problem clearly??
|
|
sandeep_4141:
2017-06-17 12:25:23
shit this d gives me 3 WA !!
|
|
sagnik_66:
2017-05-29 18:16:17
Great Problem! |
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 |