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
Menkov Andrey:
2015-05-15 14:39:32
How can I know the number of test case on which my solution is failing?
|
|
alpha coder:
2015-04-01 20:27:24
reduced it to o(n^3) using maps , still getting TLE |
|
swami:
2015-03-05 19:23:27
in java im not sorting but using collections.frequency but getting tle for 11th case
|
|
Ankit Sultana:
2015-02-07 16:25:06
Changed int *arr; arr = new int[n]; to int arr[11100] = {0}; and got AC in less than 2 seconds. |
|
Rang:
2015-02-06 17:03:10
like others have said. tight constraints. be frugal:-)(I guess the author wanted an O(N^3) solution)
|
|
Bezzam Varun:
2015-02-04 13:27:59
Some useful points:Don't use vectors. Sort the arrays using STL and check for d!=0 always. Also, there's no need to use binary search. Use a modified version of mergesort algo. AC after 4.5 hours! |
|
Jordan Alexander:
2015-02-01 00:13:44
If anyone else is having problems with the image, the Wayback Machine archived a copy of the problem back when the image still worked. |
|
Anvesh Kumar Arrabochu:
2015-01-16 09:31:14
Can be solved in O(N^3). Hint(C++): unordered_map |
|
eightnoteight:
2015-01-14 14:25:17
don't forget to read Make In India!'s note.. costed me 3 WA
|
|
Faisal Ahmed:
2015-01-07 08:24:34
"Error
|
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 |