integer concatenation
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
You are given number M, and M lines after it.
Each line contains positive integers, separated by single space.
It is possible to concat these integers in one bigger integer.
Find biggest difference between concatenated integer and its reversion.
For example:
You are given 3 positive integers:
1 3 22
It is possible to concat them in 6 ways:
1322
1223
3122
3221
2213
2231
Find that 3221 - 1223 is the biggest difference. And print it (1998).
Options
exec is denied
now post-mortem time, all source codes will be revealed
Sample input:_
1
1 3 22
Sample output:
1998
Sample input:_
6
1 2 3 4
1 9 5 32
3 3 3
99
51
444 44
Sample output:
3087
82962
0
0
36
0
Sample input:_
6
58 7 945 15 3
15 2
1 2 3 4 5 6 7
8649 12321 45
541 514 523 532
12 23 34 45
Sample output:
593900604
-99
6419754
74172962853
387189108306
24017958
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | clock | 71 | 0.0836 | 2013/03/30 01:33:38 | 0B / 42B / 26B |
2 | leonid | 71 | 0.0804 | 2013/03/30 02:30:29 | 0B / 46B / 24B |
3 | Histocrat | 72 | 0.0681 | 2013/03/02 07:10:53 | 0B / 42B / 26B |
4 | ukzk | 72 | 0.0656 | 2013/03/10 10:53:37 | 0B / 43B / 26B |
5 | jpl | 74 | 0.1115 | 2013/03/18 23:11:49 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | leonid | 108 | 0.1329 | 2013/03/02 06:15:49 | 0B / 76B / 22B |
2 | Volatility | 125 | 0.1373 | 2013/03/02 09:16:04 | 1B / 83B / 33B |
3 | davisagli | 131 | 0.1158 | 2013/03/02 04:41:18 | 0B / 85B / 37B |
4 | wilkes | 149 | 0.1206 | 2013/03/05 02:28:21 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 114 | 0.2727 | 2013/03/02 05:47:10 | 0B / 90B / 13B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 98 | 0.0314 | 2019/08/07 10:47:25 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 102 | 0.4214 | 2013/03/25 22:04:17 | 0B / 78B / 14B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 40 | 0.4738 | 2013/03/03 00:02:49 | 0B / 10B / 30B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 13 | 0.0878 | 2022/02/21 11:20:35 | 9B / 3B / 0B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | clock | 30 | 0.4636 | 2013/03/03 14:54:03 | 0B / 7B / 23B |
2 | clock | 23 | 0.5583 | 2013/09/11 19:37:01 | 0B / 8B / 15B |
3 | mroman (clock) | 25 | 0.4812 | 2013/09/11 18:59:07 | 0B / 9B / 16B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | Nibbles | tails | 13 | 10000 |
2 | Burlesque | clock | 23 | 5652 |
3 | GolfScript | tails | 40 | 3250 |
4 | J | I., S. | 62 | 2096 |
5 | Ruby | clock | 71 | 1830 |
6 | Perl | tails | 85 | 1529 |
7 | jq | pooq | 98 | 1326 |
8 | R | pooq | 102 | 1274 |
9 | Python | leonid | 108 | 1203 |
10 | Io | pooq | 114 | 1140 |
return to the top page