Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B"A burglar got into a matches warehouse and wants to steal as many matches as possible. In the warehouse there are m containers, in the i-th container there are ai matchboxes, and each matchbox contains bi matches. All the matchboxes are of the same size. The burglar's rucksack can hold n matchboxes exactly. Your task is to find out the maximum amount of matches that a burglar can carry away. He has no time to rearrange matches in the matchboxes, that's why he just chooses not more than n matchboxes so that the total amount of matches in them is maximal. The first line of the input contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7108) and integer m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8920). The i xe2 x80 x89+ xe2 x80 x891-th line contains a pair of numbers ai and bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89108, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8910). All the input numbers are integer. Output the only number -- answer to the problem."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
70082 |
Serega |
B |
June 3, 2010, 1:23 p.m. |
OK |
Delphi |
TESTS |
49 |
30 |
819200 |
|
1300 |
70070 |
ant.ermilov |
B |
June 3, 2010, 1:23 p.m. |
OK |
Delphi |
TESTS |
49 |
30 |
921600 |
|
1300 |
69783 |
GennadiyChistyakov |
B |
June 3, 2010, 1:14 p.m. |
OK |
Delphi |
TESTS |
49 |
30 |
921600 |
|
1300 |
69661 |
ghd666hw |
B |
June 3, 2010, 1:10 p.m. |
OK |
Delphi |
TESTS |
49 |
30 |
921600 |
|
1300 |
69605 |
sankear |
B |
June 3, 2010, 1:08 p.m. |
OK |
Delphi |
TESTS |
49 |
30 |
921600 |
|
1300 |
70431 |
pva701 |
B |
June 3, 2010, 1:35 p.m. |
OK |
Delphi |
TESTS |
49 |
50 |
921600 |
|
1300 |
70410 |
Abra |
B |
June 3, 2010, 1:34 p.m. |
OK |
Delphi |
TESTS |
49 |
50 |
921600 |
|
1300 |
69778 |
pershik |
B |
June 3, 2010, 1:14 p.m. |
OK |
Delphi |
TESTS |
49 |
50 |
921600 |
|
1300 |
71906 |
oskirych |
B |
June 3, 2010, 2:37 p.m. |
OK |
FPC |
TESTS |
49 |
30 |
921600 |
|
1300 |
69704 |
vilcheuski |
B |
June 3, 2010, 1:11 p.m. |
OK |
FPC |
TESTS |
49 |
30 |
1024000 |
|
1300 |
71826 |
Denor |
B |
June 3, 2010, 2:33 p.m. |
OK |
FPC |
TESTS |
49 |
30 |
1024000 |
|
1300 |
71380 |
PAG |
B |
June 3, 2010, 2:13 p.m. |
OK |
FPC |
TESTS |
49 |
30 |
1024000 |
|
1300 |
70819 |
leito |
B |
June 3, 2010, 1:49 p.m. |
OK |
FPC |
TESTS |
49 |
30 |
1024000 |
|
1300 |
69916 |
nhok_kot |
B |
June 3, 2010, 1:17 p.m. |
OK |
FPC |
TESTS |
49 |
30 |
1024000 |
|
1300 |
69853 |
Furko |
B |
June 3, 2010, 1:15 p.m. |
OK |
FPC |
TESTS |
49 |
30 |
1024000 |
|
1300 |
70854 |
sunzuhan |
B |
June 3, 2010, 1:51 p.m. |
OK |
GNU C |
TESTS |
49 |
30 |
1331200 |
|
1300 |
69969 |
china.zhangchenzi |
B |
June 3, 2010, 1:19 p.m. |
OK |
GNU C |
TESTS |
49 |
30 |
1331200 |
|
1300 |
70093 |
05yesterday |
B |
June 3, 2010, 1:23 p.m. |
OK |
GNU C++ |
TESTS |
49 |
10 |
1331200 |
|
1300 |
72340 |
sujz |
B |
June 3, 2010, 2:56 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
72299 |
Khaled91 |
B |
June 3, 2010, 2:54 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
72119 |
msh_shiplu |
B |
June 3, 2010, 2:47 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
72053 |
pod2metra |
B |
June 3, 2010, 2:43 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71837 |
ivancastel |
B |
June 3, 2010, 2:33 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71603 |
afMartinez |
B |
June 3, 2010, 2:23 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71589 |
komron_hkl |
B |
June 3, 2010, 2:22 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71583 |
dennismv |
B |
June 3, 2010, 2:22 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71580 |
Figo |
B |
June 3, 2010, 2:22 p.m. |
OK |
GNU C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71329 |
segoon |
B |
June 3, 2010, 2:11 p.m. |
OK |
Haskell |
TESTS |
49 |
30 |
2048000 |
|
1300 |
69925 |
I_love_Malika |
B |
June 3, 2010, 1:18 p.m. |
OK |
Java 6 |
TESTS |
49 |
60 |
42188800 |
|
1300 |
69950 |
Shafer |
B |
June 3, 2010, 1:18 p.m. |
OK |
Java 6 |
TESTS |
49 |
60 |
42188800 |
|
1300 |
69905 |
agus.mw |
B |
June 3, 2010, 1:17 p.m. |
OK |
Java 6 |
TESTS |
49 |
60 |
42188800 |
|
1300 |
69527 |
xiaowuc1 |
B |
June 3, 2010, 1:06 p.m. |
OK |
Java 6 |
TESTS |
49 |
60 |
42188800 |
|
1300 |
69526 |
fetetriste |
B |
June 3, 2010, 1:06 p.m. |
OK |
Java 6 |
TESTS |
49 |
60 |
42188800 |
|
1300 |
70238 |
Rustem |
B |
June 3, 2010, 1:28 p.m. |
OK |
Java 6 |
TESTS |
49 |
80 |
42188800 |
|
1300 |
69972 |
tomerun |
B |
June 3, 2010, 1:19 p.m. |
OK |
Java 6 |
TESTS |
49 |
80 |
42188800 |
|
1300 |
71212 |
sjbr |
B |
June 3, 2010, 2:06 p.m. |
OK |
Java 6 |
TESTS |
49 |
80 |
42188800 |
|
1300 |
69877 |
vlad.gazer |
B |
June 3, 2010, 1:16 p.m. |
OK |
Java 6 |
TESTS |
49 |
80 |
42188800 |
|
1300 |
71016 |
sirhally |
B |
June 3, 2010, 1:57 p.m. |
OK |
Java 6 |
TESTS |
49 |
80 |
42188800 |
|
1300 |
70563 |
Tactic |
B |
June 3, 2010, 1:40 p.m. |
OK |
Mono C# |
TESTS |
49 |
110 |
5939200 |
|
1300 |
70500 |
mathew_s |
B |
June 3, 2010, 1:37 p.m. |
OK |
Mono C# |
TESTS |
49 |
110 |
6041600 |
|
1300 |
71705 |
chandubaba |
B |
June 3, 2010, 2:27 p.m. |
OK |
Mono C# |
TESTS |
49 |
130 |
6041600 |
|
1300 |
69906 |
TryCSharp |
B |
June 3, 2010, 1:17 p.m. |
OK |
Mono C# |
TESTS |
49 |
140 |
5939200 |
|
1300 |
71047 |
a286729485 |
B |
June 3, 2010, 1:59 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71106 |
Tkei |
B |
June 3, 2010, 2:01 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
72402 |
Alisafe |
B |
June 3, 2010, 2:58 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71656 |
ddd |
B |
June 3, 2010, 2:25 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71558 |
A_wu |
B |
June 3, 2010, 2:21 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71496 |
A_wu |
B |
June 3, 2010, 2:18 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71461 |
shmel |
B |
June 3, 2010, 2:17 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71444 |
darrren |
B |
June 3, 2010, 2:16 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71399 |
darrren |
B |
June 3, 2010, 2:14 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71048 |
d.a.sukhodolov |
B |
June 3, 2010, 1:59 p.m. |
OK |
MS C++ |
TESTS |
49 |
30 |
1331200 |
|
1300 |
71887 |
xydinesh |
B |
June 3, 2010, 2:36 p.m. |
OK |
Python 2 |
TESTS |
49 |
60 |
2764800 |
|
1300 |
70441 |
asitak |
B |
June 3, 2010, 1:35 p.m. |
OK |
Python 2 |
TESTS |
49 |
60 |
2764800 |
|
1300 |
70159 |
shiumachi |
B |
June 3, 2010, 1:26 p.m. |
OK |
Python 2 |
TESTS |
49 |
60 |
2764800 |
|
1300 |
70112 |
jaindsonvs |
B |
June 3, 2010, 1:24 p.m. |
OK |
Python 2 |
TESTS |
49 |
60 |
2764800 |
|
1300 |
69756 |
insejniasty |
B |
June 3, 2010, 1:13 p.m. |
OK |
Python 2 |
TESTS |
49 |
60 |
2764800 |
|
1300 |
70136 |
urutom |
B |
June 3, 2010, 1:25 p.m. |
OK |
Ruby |
TESTS |
49 |
60 |
3891200 |
|
1300 |
remove filters
Back to search problems