Examples

Examples

saturnix's picture

Hello, can you please send me more examples of the script expected results? These has been really useful but I need some with much much higher numbers to stress my script at its limit. Is it possible? Also, I wrote my entire code in C: is this ok? Thanks! J. sum(3:5) = 8 = 2**3
sum(17:19) = 36 = 6**2
sum(2:23) = 100 = 10**2
sum(13:19) = 49 = 7**2
sum(5:13) = 36 = 6**2

20 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
duncanhopkins's picture

I am not promising these are 100% correct but some of the result I have been getting are:

500 1000 32:
sum(881:883) = 1764 = 42**2
sum(613:619) = 1849 = 43**2
sum(569:587) = 2304 = 48**2
sum(587:613) = 3600 = 60**2
sum(661:727) = 6241 = 79**2
sum(653:739) = 9025 = 95**2
sum(673:947) = 32400 = 180**2
sum(523:839) = 32768 = 2**15

20001000 20012000 80:
sum(20005603:20005693) = 120033936 = 10956**2
sum(20009047:20010127) = 1260605025 = 35505**2
sum(20001551:20002831) = 1420159225 = 37685**2
sum(20009597:20011723) = 2561372100 = 50610**2
sum(20001439:20007661) = 7241669604 = 85098**2

jmfernandez's picture

Hi DuncanHopkins,

Thanks for posting your results. With my solution I am obtaining exactly same results, so I guess these are correct.

duncanhopkins's picture

Has anybody got any interesting ranges in the 2G to 4G ranges?

hitesh.sharma's picture

Hi Duncan
thx for the examples, these are pretty usefule.

saturnix's picture

I've tried some of them randomly and they worked to me too. If you want me to try some just post the numbers. Thanks!

VoVanx86's picture

[4G - 1000000, 4G) is very interesting range (max power - 28).
Result: 109 summs

jmfernandez's picture

Hi VoVanx86,

I also get 109 solutions in that range, but I am using [4G-1000000, 4G-1] since 4Gis out of the valid range according to the problem statement.

By the way, my solutions:

sum(4293974227:4294570229) = 115142321132721 = 10730439**2
sum(4293979061:4294118207) = 26880740792896 = 5184664**2
sum(4293979073:4294116023) = 26481388044049 = 5146007**2
sum(4293991249:4294158559) = 32385910303044 = 5690862**2
sum(4294013173:4294024829) = 2288712096801 = 1512849**2
sum(4294014119:4294525373) = 98673746773156 = 9933466**2
sum(4294014667:4294879051) = 166474222395121 = 12902489**2
sum(4294015577:4294135031) = 22887421446400 = 4784080**2
sum(4294020683:4294188331) = 32283078512400 = 5681820**2
sum(4294021877:4294024447) = 515282780224 = 717832**2
sum(4294035737:4294072877) = 7072307303161 = 2659381**2
sum(4294036847:4294954441) = 176563874854756 = 13287734**2
sum(4294038689:4294597861) = 107817466823361 = 10383519**2
sum(4294046959:4294087529) = 7587617320969 = 2754563**2
sum(4294053661:4294256231) = 38909337930225 = 6237735**2
sum(4294061819:4294547863) = 93817685518209 = 9685953**2
sum(4294070909:4294188397) = 22621476489616 = 4756204**2
sum(4294073489:4294187717) = 22024596283369 = 4693037**2
sum(4294083427:4294509907) = 82377497202025 = 9076205**2
sum(4294086007:4294165543) = 15441677568100 = 3929590**2
sum(4294096889:4294107269) = 2035404408976 = 1426676**2
sum(4294104431:4294723157) = 119629496875729 = 10937527**2
sum(4294110593:4294118069) = 1429940031601 = 1195801**2
sum(4294118267:4294130219) = 2344591814436 = 1531206**2
sum(4294129379:4294691039) = 108584173459129 = 10420373**2
sum(4294146287:4294494467) = 67236178854289 = 8199767**2
sum(4294153771:4294200499) = 8974829623204 = 2995802**2
sum(4294160489:4294276631) = 22136695651225 = 4704965**2
sum(4294176281:4294401581) = 43393799235609 = 6587397**2
sum(4294177729:4294336933) = 30416228738281 = 5515091**2
sum(4294187099:4294237487) = 9644801049664 = 3105608**2
sum(4294188023:4294359869) = 33040147779136 = 5748056**2
sum(4294195921:4294390171) = 37540717194304 = 6127048**2
sum(4294201519:4294772047) = 110132116528225 = 10494385**2
sum(4294203673:4294288171) = 16013242739025 = 4001655**2
sum(4294203931:4294223149) = 3577079994489 = 1891317**2
sum(4294204469:4294232167) = 5251829305969 = 2291687**2
sum(4294217149:4294903673) = 132263846362404 = 11500602**2
sum(4294231589:4294690391) = 88736456520009 = 9420003**2
sum(4294248239:4294250549) = 459484689609 = 677853**2
sum(4294248523:4294478897) = 44558321740804 = 6675202**2
sum(4294269541:4294486291) = 42084905594944 = 6487288**2
sum(4294272559:4294422877) = 29171503134225 = 5401065**2
sum(4294273273:4294863913) = 113999289932025 = 10677045**2
sum(4294275533:4294745501) = 91116627523009 = 9545503**2
sum(4294290019:4294448351) = 30709031314329 = 5541573**2
sum(4294293307:4294444991) = 29377776696129 = 5420127**2
sum(4294325029:4294329269) = 777273220161 = 881631**2
sum(4294338163:4294897121) = 107683208210704 = 10377052**2
sum(4294349599:4294765547) = 80591663925796 = 8977286**2
sum(4294349887:4294939333) = 113520309377281 = 10654591**2
sum(4294350551:4294486543) = 26436441323044 = 5141638**2
sum(4294352171:4294853683) = 96671488251556 = 9832166**2
sum(4294353689:4294598323) = 47393834325124 = 6884318**2
sum(4294355027:4294372729) = 3615854371600 = 1901540**2
sum(4294362701:4294816919) = 87528018520881 = 9355641**2
sum(4294371457:4294373773) = 485264098881 = 696609**2
sum(4294376797:4294383529) = 1326963459721 = 1151939**2
sum(4294380689:4294883711) = 96822470905281 = 9839841**2
sum(4294385609:4294700477) = 61016876368900 = 7811330**2
sum(4294386653:4294838591) = 86991660532624 = 9326932**2
sum(4294389689:4294684151) = 56932683890625 = 7545375**2
sum(4294400437:4294535711) = 26101778820100 = 5108990**2
sum(4294401253:4294864517) = 89122209487936 = 9440456**2
sum(4294424933:4294441843) = 3190764085441 = 1786271**2
sum(4294425601:4294546859) = 23465072293776 = 4844076**2
sum(4294434931:4294459201) = 4633708286025 = 2152605**2
sum(4294444507:4294452793) = 1640479379344 = 1280812**2
sum(4294445849:4294779821) = 64543725955921 = 8033911**2
sum(4294451881:4294455587) = 639873606241 = 799921**2
sum(4294484891:4294492907) = 1503071096004 = 1225998**2
sum(4294486793:4294488937) = 373620450025 = 611245**2
sum(4294503391:4294552657) = 9443667033025 = 3073055**2
sum(4294511701:4294708633) = 38234917866721 = 6183439**2
sum(4294526297:4294599553) = 14060400078400 = 3749720**2
sum(4294535813:4294643459) = 20841644520225 = 4565265**2
sum(4294536479:4294963349) = 81905160721609 = 9050147**2
sum(4294541203:4294541897) = 141719872849 = 376457**2
sum(4294555513:4294937957) = 73384322596225 = 8566465**2
sum(4294562099:4294741993) = 34919814671401 = 5909299**2
sum(4294563157:4294963847) = 76889135136025 = 8768645**2
sum(4294565159:4294613371) = 9362204691984 = 3059772**2
sum(4294565879:4294688449) = 23805119144401 = 4879049**2
sum(4294573277:4294939549) = 70279383558400 = 8383280**2
sum(4294573739:4294711541) = 26789982217216 = 5175904**2
sum(4294574563:4294581563) = 1322730010000 = 1150100**2
sum(4294579349:4294597943) = 3573097989696 = 1890264**2
sum(4294589921:4294614451) = 4848605822025 = 2201955**2
sum(4294593707:4294922353) = 62931076933921 = 7932911**2
sum(4294597481:4294624489) = 4998926845584 = 2235828**2
sum(4294611017:4294612013) = 210435965289 = 458733**2
sum(4294617203:4294629197) = 2190257922304 = 1479952**2
sum(4294635913:4294882859) = 47366892934321 = 6882361**2
sum(4294644401:4294700647) = 11050192617489 = 3324183**2
sum(4294646099:4294722391) = 14863900969129 = 3855373**2
sum(4294648691:4294757711) = 21228715296369 = 4607463**2
sum(4294650497:4294886423) = 45253968589449 = 6727107**2
sum(4294660703:4294737553) = 14898310787889 = 3859833**2
sum(4294667129:4294945069) = 53066620979856 = 7284684**2
sum(4294703291:4294714703) = 2160238550625 = 1469775**2
sum(4294731943:4294732943) = 167494566121 = 409261**2
sum(4294744873:4294766101) = 4071428057284 = 2017778**2
sum(4294753147:4294947191) = 36742449018025 = 6061555**2
sum(4294763183:4294772423) = 1644896026225 = 1282535**2
sum(4294796771:4294959049) = 30914534087056 = 5560084**2
sum(4294821677:4294867051) = 8714239056121 = 2951989**2
sum(4294886423:4294946251) = 11347169525136 = 3368556**2
sum(4294892201:4294954721) = 12000016522816 = 3464104**2
sum(4294951477:4294962533) = 2108823848041 = 1452179**2

VoVanx86's picture

Hi, ")" means that left bound are excluded from range.

[4G - 1 000 000, 4G) = [4G - 1 000 000, 4G-1]

My next ranges:

[4G - 10 000 000, 4G-1] =3069

and

[4G - 100 000 000, 4G-1] =97939

duncanhopkins's picture

Out of interest, which spec machine are you calculating these on? Home quad core or MTL monster core?
Ta.

jmfernandez's picture

Hi VoVanx86,

Sorry, I didn't realize that the ending character was a parenthesis, not a square bracket.

VoVanx86's picture

Of course MTL.
(quad core machine speed) ~ (MTL speed)/10 (corrected)

dotcsw's picture
Here's an interesting test case of higher exponents:
2189273 8555623 41

It produces 79,598 results including this one:
sum(2189273:8555623) = 2199023255552 = 2**41

Quoting VoVanx86 Of course MTL.
(quad core machine time) ~ (MTL time)/10

Are you saying that 8 threads on your home quad core are faster than 80 (or 64) threads on MTL? I noticed that too and feared I had messed something up again. UPDATE: My mistake. MTL is faster than my quad core.

- Rick

VoVanx86's picture

I meant calculation speed... Not time :)))))

(4 threads on my home mobile core i3) ~ (30 threads on MTL (MTL on windows without HT))/10

And thanks for example. I found one bug.

dotcsw's picture
Quoting dotcsw I noticed that too and feared I had messed something up again.

Never mind. I was looking at results from a different benchmark. 80 threads on the MTL is faster than 8 threads on my quad core. Not 10 times faster but good enough. I've corrected my post above.

- Rick

saturnix's picture

"It produces 79,598 results including this one:" Why are you counting your results? Is this required in the specs? Ty!

dotcsw's picture
Quoting saturnix Why are you counting your results? Is this required in the specs?

No. I would have posted the results here except there were 79K of them! A count gives others a chance to compare and see if they got them all (or tell me that my count was wrong).

- Rick

duncanhopkins's picture

Which is much appreciated. Thanks.
It also gives others an idea of how large the output files might get.

dotcsw's picture
Quoting VoVanx86 My next ranges:

[4G - 10 000 000, 4G-1] =3069

and

[4G - 100 000 000, 4G-1] =97939

I can confirm those output counts: 3069 and 97939. Although I don't expect we'll see a problem the size of that 100,000,000 test in the judging. They try to limit the problem domain to those that a typical program can solve in under 15 minutes.

- Rick

varslan's picture

I have the same results,

I solved the problem with a O( N ) algorithm so if I compute 1 M steps in 10 sec I will compute 10 M in 1000 sec... So I m not able to go further than 100 000 000

Login to leave a comment.