Coding Challenge 4!

The Partridge Family were neither partridges nor a family. Discuss.
Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

Re: Coding Challenge 4!

Post by Pindrought » September 23rd, 2018, 5:06 am

chili wrote:@yum

Yeah, the base fast algo is very simple indeed, so it's highly possible that you missed nothing and just submitted the expected solution.

And I don't think you'll be disappointed by the optimizations ;)
Can't wait to see what you came up with. I remember the last coding challenge I participated in I was pretty amazed by the speeds you achieved.
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

colencon
Posts: 35
Joined: February 13th, 2014, 2:24 pm

Re: Coding Challenge 4!

Post by colencon » September 23rd, 2018, 6:50 am

Code: Select all

PASS (0.01ms) File Test: Buck Futter's Sexy Test 1
PASS (0.01ms) File Test: Buck Futter's Sexy Test 2
PASS (0.01ms) File Test: Buck Futter's Sexy Test 3
PASS (0.00ms) File Test: Buck Futter's Sexy Test 4
PASS (0.00ms) File Test: Buck Futter's Sexy Test 5
PASS (0.00ms) File Test: Buck Futter's Sexy Test 6
PASS (436.93ms) File Test: NF Test
PASS (359.87ms) File Test: NF Test 2
i have 150ms for 8m, i though with 80m i need 1500ms, and will fail the test. Phew!!!
Last edited by colencon on September 23rd, 2018, 10:31 am, edited 1 time in total.

NightFighter
Posts: 8
Joined: September 22nd, 2018, 6:32 pm
Location: United Kingdom

Re: Coding Challenge 4!

Post by NightFighter » September 23rd, 2018, 7:47 am

Well I updated my code and get

Code: Select all

PASS (0.67ms) File Test: Buck Futter's Sexy Test 1
PASS (0.08ms) File Test: Buck Futter's Sexy Test 2
PASS (0.35ms) File Test: Buck Futter's Sexy Test 3
PASS (0.38ms) File Test: Buck Futter's Sexy Test 4
PASS (0.08ms) File Test: Buck Futter's Sexy Test 5
PASS (0.08ms) File Test: Buck Futter's Sexy Test 6
PASS (134.40ms) File Test: NF Test
PASS (138.44ms) File Test: NF Test
PASS (136.20ms) File Test: NF Test
PASS (106.63ms) File Test: NF Test 2
PASS (97.65ms) File Test: NF Test 2
PASS (94.29ms) File Test: NF Test 2
Funnaly my algorithm actually runs faster on one core than 4, so all my knowledge of std::thread and std::async didn't help me in this challenge :(

Slidy
Posts: 79
Joined: September 9th, 2017, 1:19 pm

Re: Coding Challenge 4!

Post by Slidy » September 23rd, 2018, 7:52 am

Here are my results:

Code: Select all

PASS (0ms) File Test: Buck Futter's Sexy Test 1
PASS (0.000928ms) File Test: Buck Futter's Sexy Test 2
PASS (0ms) File Test: Buck Futter's Sexy Test 3
PASS (0ms) File Test: Buck Futter's Sexy Test 4
PASS (0ms) File Test: Buck Futter's Sexy Test 5
PASS (0.000464ms) File Test: Buck Futter's Sexy Test 6
PASS (0.006492ms) File Test: Slidy's Test (10,000 nums)
PASS (0.064ms) File Test: Slidy's Test (100,000 nums)
PASS (0.509219ms) File Test: Slidy's Test (800,000 nums)
PASS (6.13659ms) File Test: Slidy's Test (8,000,000 nums)
PASS (53.0116ms) File Test: NF Test
PASS (42.382ms) File Test: NF Test 2
I'm not sure if our results are comparable since we're all running on different machines.
As for the multithreading thing I got the same results. Doing this on a single thread with a good algo beat out a different approach with multiple threads.

FinalL
Posts: 53
Joined: February 6th, 2014, 3:44 pm
Location: Slovakia

Re: Coding Challenge 4!

Post by FinalL » September 23rd, 2018, 8:22 am

generating a 80M testfile takes like 10 minutes of proper cooking for me :D
Many noodles, one sauce.
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator

User avatar
chili
Site Admin
Posts: 3939
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Coding Challenge 4!

Post by chili » September 23rd, 2018, 8:50 am

Keep in mind, you might still pass if you're close to 1000ms, depending on your computer's speed relative to mine :)
Chili

Yordrar
Posts: 2
Joined: September 22nd, 2018, 8:20 pm

Re: Coding Challenge 4!

Post by Yordrar » September 23rd, 2018, 1:09 pm

i'm seeing a lot of people use threads in their programs but the challenge states that we can only use stdlib and the compiler stuff so, am i missing something or what?

User avatar
Yumtard
Posts: 571
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Coding Challenge 4!

Post by Yumtard » September 23rd, 2018, 2:37 pm

std::thread

NightFighter
Posts: 8
Joined: September 22nd, 2018, 6:32 pm
Location: United Kingdom

Re: Coding Challenge 4!

Post by NightFighter » September 23rd, 2018, 3:05 pm

Yumtard wrote:std::thread
there is also std::async in <future> (witch I find from minor testing launches and closes faster)

User avatar
chili
Site Admin
Posts: 3939
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Coding Challenge 4!

Post by chili » September 23rd, 2018, 5:56 pm

std::async uses thread pools in most impls, so it tends to be more agile.
Chili

Post Reply