From c78bf218fb6d75d478fef09b8067a23332d4de45 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Mon, 17 Jul 2017 11:26:27 +0100 Subject: [PATCH] Tweaked Sense implementation, updated runtimes --- .../resolving-the-bill-solution.ipynb | 32 +++++++++--------- 09-resolving-the-bill/summer09.sb | Bin 88310 -> 88139 bytes 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/09-resolving-the-bill/resolving-the-bill-solution.ipynb b/09-resolving-the-bill/resolving-the-bill-solution.ipynb index 3643807..3d9d63f 100644 --- a/09-resolving-the-bill/resolving-the-bill-solution.ipynb +++ b/09-resolving-the-bill/resolving-the-bill-solution.ipynb @@ -1353,31 +1353,31 @@ "source": [ "# Sense solution\n", "Took \n", - "* 22.9 seconds to load file\n", - "* 14906.8 seconds to find subsequences (4.14 hours; 4 hours, 8 minutes, 26.8 seconds)\n", - "* 41726.9 seconds to check all interleavings (11.59 hours; 11 hours, 35 minutes, 26.9 seconds)\n", + "* 25.8 seconds to load file\n", + "* 15203.9 seconds to find subsequences (4.22 hours; 4 hours, 13 minutes, 23.9 seconds)\n", + "* 40083.8 seconds to check all interleavings (11.13 hours; 11 hours, 8 minutes, 3.8 seconds)\n", "\n", - "Total of 15 hours 44 minutes 16.6 seconds." + "Total of 15 hours 21 minutes 53.5 seconds." ] }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "(4.140777777777777, 4, 8, 26.799999999999272)" + "(4.223305555555555, 4, 13, 23.899999999999636)" ] }, - "execution_count": 19, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "rtime = 14906.8\n", + "rtime = 15203.9\n", "(rtime / 3600,\n", " int(rtime / 3600), \n", " int(rtime / 60 - int(rtime / 3600) * 60), \n", @@ -1387,22 +1387,22 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "(11.590805555555557, 11, 35, 26.900000000001455)" + "(11.13438888888889, 11, 8, 3.8000000000029104)" ] }, - "execution_count": 20, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "rtime = 41726.9 \n", + "rtime = 40083.8\n", "(rtime / 3600,\n", " int(rtime / 3600), \n", " int(rtime / 60 - int(rtime / 3600) * 60), \n", @@ -1412,22 +1412,22 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "(15.737944444444445, 15, 44, 16.599999999998545)" + "(15.36486111111111, 15, 21, 53.5)" ] }, - "execution_count": 21, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "rtime = 22.9 + 14906.8 + 41726.9 \n", + "rtime = 25.8 + 15203.9 +40083.8\n", "(rtime / 3600,\n", " int(rtime / 3600), \n", " int(rtime / 60 - int(rtime / 3600) * 60), \n", diff --git a/09-resolving-the-bill/summer09.sb b/09-resolving-the-bill/summer09.sb index aed7a84359848c188951462ab89ef11e3cd96f63..59818ab8788bb2b2508cea00922f01cbebc957be 100644 GIT binary patch delta 5535 zcmZ`+eQ;b=72lI&ceCG{o0r{9Hm`3#Ze${fZLnBr)k#fC18pg7FbK6HF-_Y*l76Ly z0__$l<8(%a@=6}n0)>ACrIXRl0Ma5VAEi~~52vFuSiZ!;aYmgH{Y!u6-1m|#>f4-m z?>*;t?mhQ>-23v6Q{i*ZhC7GHc8|`CZ68^3RVdVUV*NL6AEsf9DHIAVJ=!@!Uq7|y z^WpH75A>Dj-X zz4X40YRj^0D{5)259nxGDHT&urSf)*9nC9S@7D>4ETxi35i~TlG({U#3W6&|kc`Cf zL?V%RM5%^wOve)8L?WgWiEvo!aIL8htAJH;;x}UxIu;ACF<=ceifQc>8xiHTnpKu9 z%R<8jGbMJ~sZ{ECDy-WWrt%NuSjlQrMc9yY%u}gwJMEysU&@I(j&@?sr6+{1eUu2% z*9>x;lDq>%)u1q}7>O2G#Yg)(0h?`zE0a!$2Ut(GcyRV$@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