From 0940598c235f99ecf516096dd3f5c9e8f08e826f Mon Sep 17 00:00:00 2001 From: Alfredo Beaumont Date: Tue, 12 May 2020 23:24:53 +0200 Subject: [PATCH] [codejam - 2016-qualification] Add Racket solution for C. --- codejam/2016-qualification/c-1.ans | 4 + codejam/2016-qualification/c-1.in | 2 + codejam/2016-qualification/c-2.ans | 51 +++ codejam/2016-qualification/c-2.in | 2 + codejam/2016-qualification/c-3.ans | 501 +++++++++++++++++++++ codejam/2016-qualification/c-3.in.disabled | 2 + codejam/2016-qualification/c.rkt | 34 ++ codejam/README.md | 2 + 8 files changed, 598 insertions(+) create mode 100644 codejam/2016-qualification/c-1.ans create mode 100644 codejam/2016-qualification/c-1.in create mode 100644 codejam/2016-qualification/c-2.ans create mode 100644 codejam/2016-qualification/c-2.in create mode 100644 codejam/2016-qualification/c-3.ans create mode 100644 codejam/2016-qualification/c-3.in.disabled create mode 100755 codejam/2016-qualification/c.rkt diff --git a/codejam/2016-qualification/c-1.ans b/codejam/2016-qualification/c-1.ans new file mode 100644 index 00000000..c8c89783 --- /dev/null +++ b/codejam/2016-qualification/c-1.ans @@ -0,0 +1,4 @@ +Case #1: +100111 3 2 5 2 7 2 3 2 11 +100011 5 13 3 31 43 3 73 7 3 +100001 3 2 5 2 7 2 3 2 11 diff --git a/codejam/2016-qualification/c-1.in b/codejam/2016-qualification/c-1.in new file mode 100644 index 00000000..1973ac69 --- /dev/null +++ b/codejam/2016-qualification/c-1.in @@ -0,0 +1,2 @@ +1 +6 3 diff --git a/codejam/2016-qualification/c-2.ans b/codejam/2016-qualification/c-2.ans new file mode 100644 index 00000000..39ffa3c6 --- /dev/null +++ b/codejam/2016-qualification/c-2.ans @@ -0,0 +1,51 @@ +Case #1: +1000000010110101 3 2 3 2 7 2 3 2 3 +1000000010110011 47 2 3 2 11 2 204311 2 3 +1000000010101001 3 5 13 3 5 43 3 73 7 +1000000010100111 5 2 3 2 37 2 5 2 3 +1000000010100011 3 1259 421 3 5 8893 3 67 17 +1000000010011101 3 2 3 2 7 2 3 2 3 +1000000010011011 11 2 3 2 13 2 47 2 3 +1000000010011001 7 1667 179 13 5 11 23 7 311 +1000000010010111 3 2 3 2 7 2 3 2 3 +1000000010010001 3 2 5 2 7 2 3 2 7 +1000000010001001 5 2 7 2 1933 2 29 2 157 +1000000010000101 3 2 5 2 7 2 3 2 11 +1000000010000011 167 2 11 2 58427 2 23 2 839 +1000000001111111 3 2 5 2 7 2 3 2 7 +1000000001111101 7 19 43 17 55987 23 7 7 31 +1000000001111011 31 557 7 19 23 1129 7 5441 241 +1000000001111001 3 2 3 2 7 2 3 2 3 +1000000001110101 5 2 3 2 37 2 5 2 3 +1000000001110011 3 2 3 2 7 2 3 2 3 +1000000001101101 3 2 3 2 7 2 3 2 3 +1000000001101011 5 2 3 2 37 2 5 2 3 +1000000001100111 3 2 3 2 7 2 3 2 3 +1000000001100011 23 19 11 105491 5 47 11117 1787 127 +1000000001100001 3 2 5 2 7 2 3 2 11 +1000000001011111 59 113 7 157 19 1399 7 43 107 +1000000001011101 17 2 3 2 1297 2 11 2 3 +1000000001011011 3 2 3 2 7 2 3 2 3 +1000000001011001 11 5 281 101 5 67 5 13 19 +1000000001010111 5 2 3 2 37 2 5 2 3 +1000000001010101 3 7 13 3 5 17 3 53 7 +1000000001001111 3 2 3 2 7 2 3 2 3 +1000000001001001 3 2 5 2 7 2 3 2 7 +1000000001000011 3 2 5 2 7 2 3 2 11 +1000000000111101 3 2 3 2 7 2 3 2 3 +1000000000111011 17 2 3 2 73 2 17 2 3 +1000000000110111 3 2 3 2 7 2 3 2 3 +1000000000110101 23 17 11 23 5 299699 43 239 59 +1000000000110001 3 2 5 2 7 2 3 2 11 +1000000000101111 5 2 3 2 37 2 5 2 3 +1000000000101011 3 7 13 3 5 43 3 73 7 +1000000000100101 3 2 5 2 7 2 3 2 7 +1000000000011111 3 2 3 2 7 2 3 2 3 +1000000000011011 5 1567 15559 6197 5 5 1031 7 83 +1000000000011001 3 2 5 2 7 2 3 2 11 +1000000000010011 3 2 5 2 7 2 3 2 7 +1000000000001101 3 2 5 2 7 2 3 2 11 +1000000000001001 73 5 3 19 19 3 5 19 3 +1000000000000111 3 2 5 2 7 2 3 2 11 +1000000000000101 13 11 3 4751 173 3 53 109 3 +1000000000000001 3 2 5 2 7 2 3 2 7 diff --git a/codejam/2016-qualification/c-2.in b/codejam/2016-qualification/c-2.in new file mode 100644 index 00000000..851fa398 --- /dev/null +++ b/codejam/2016-qualification/c-2.in @@ -0,0 +1,2 @@ +1 +16 50 diff --git a/codejam/2016-qualification/c-3.ans b/codejam/2016-qualification/c-3.ans new file mode 100644 index 00000000..e065c20b --- /dev/null +++ b/codejam/2016-qualification/c-3.ans @@ -0,0 +1,501 @@ +Case #1: +10000000000000000000010110100011 23 7 7 19 4099 73 7 263 7 +10000000000000000000010110100001 3 2 3 2 7 2 3 2 3 +10000000000000000000010110011011 3 2 5 2 7 2 3 2 11 +10000000000000000000010110010101 3 5 7 3 19 13 3 317 953 +10000000000000000000010110001111 3 2 5 2 7 2 3 2 11 +10000000000000000000010110001101 37 7 8741 29 149 13907 7 293 7 +10000000000000000000010110001011 7 5 11 7 11 11 5 7 29 +10000000000000000000010110001001 3 2 3 2 7 2 3 2 3 +10000000000000000000010110000101 29 2 3 2 17 2 67 2 3 +10000000000000000000010110000011 3 2 3 2 7 2 3 2 3 +10000000000000000000010101111111 5 2 17 2 5 2 5 2 101 +10000000000000000000010101111101 3 7 3 3 17 3 3 7 3 +10000000000000000000010101111011 19 18287 3 19 13 3 101 461 3 +10000000000000000000010101111001 14813 2 114156943 2 76463 2 233 2 83 +10000000000000000000010101110111 3 19 3 3 44257 3 3 31 3 +10000000000000000000010101110101 5 2 17 2 37 2 5 2 79 +10000000000000000000010101110011 11 2 50128607 2 457 2 157 2 23 +10000000000000000000010101110001 3 4709417 23 3 119159 12781 3 37 2221 +10000000000000000000010101101111 7 13 3 17 43 3 73 7 3 +10000000000000000000010101101101 47 2 31 2 307 2 101 2 420573296707309 +10000000000000000000010101101011 3 2 5 2 7 2 3 2 11 +10000000000000000000010101100111 353 2 5849 2 41 2 61 2 7 +10000000000000000000010101100011 239 29 53 7 11 17 7 11 163 +10000000000000000000010101100001 5 2 3 2 37 2 5 2 3 +10000000000000000000010101011101 11 2 355027 2 357161951 2 487 2 127 +10000000000000000000010101011011 73 2 7 2 29 2 23 2 17 +10000000000000000000010101011001 3 5 13 3 11 43 3 19 7 +10000000000000000000010101010111 5 2 17 2 13 2 5 2 101 +10000000000000000000010101010101 19 17 5 19 1033 59 7 5 9043 +10000000000000000000010101010011 3 919 73 3 92449859209 479967391 3 7 149 +10000000000000000000010101010001 59 2 3 2 15401 2 11 2 3 +10000000000000000000010101001111 103 2 19 2 11 2 1039 2 41 +10000000000000000000010101001101 3 1789 11 3 373 5 3 89 4759 +10000000000000000000010101001011 29 83 223 124343 27058103 47 7 65551 13187 +10000000000000000000010101000111 3 967 157 3 17 71 3 1549 151 +10000000000000000000010101000101 7 2 3 2 43 2 73 2 3 +10000000000000000000010101000011 5 2 3 2 37 2 5 2 3 +10000000000000000000010101000001 3 131 67 3 5 11 3 59 5441 +10000000000000000000010100111101 13 2 11 2 4153 2 11 2 11257 +10000000000000000000010100111011 3 2 5 2 7 2 3 2 7 +10000000000000000000010100110111 7 2 21613 2 157 2 97 2 269 +10000000000000000000010100110101 3 7 13 3 31 37 3 73 7 +10000000000000000000010100110001 11 2 3 2 13 2 31 2 3 +10000000000000000000010100101111 3 2 5 2 7 2 3 2 11 +10000000000000000000010100101101 43 29 109 23 61 29 7 11 8390397898783 +10000000000000000000010100101001 3 2 3 2 7 2 3 2 3 +10000000000000000000010100100111 251 47 31118953 167 1319 28933 7 29 57917 +10000000000000000000010100100101 5 2 3 2 37 2 5 2 3 +10000000000000000000010100100011 3 2 3 2 7 2 3 2 3 +10000000000000000000010100011001 23 2 3 2 17 2 43 2 3 +10000000000000000000010100010111 3 313 7 3 41 11 3 1493 590929 +10000000000000000000010100010001 3 7 13 3 5 5 3 73 7 +10000000000000000000010100001111 47 7 11 211 13 3037 7 149 7 +10000000000000000000010100001101 7 2 3 2 11 2 73 2 3 +10000000000000000000010100001011 3 2 3 2 7 2 3 2 3 +10000000000000000000010100000111 5 2 3 2 37 2 5 2 3 +10000000000000000000010011111111 3 2 5 2 5 2 3 2 11 +10000000000000000000010011111001 3 2 5 2 7 2 3 2 11 +10000000000000000000010011110101 31 2 101 2 13 2 18105307890563 2 47 +10000000000000000000010011110011 3 2 5 2 7 2 3 2 11 +10000000000000000000010011110001 7 7 19 46589 23 587371 7 7 7 +10000000000000000000010011101111 11 5 3 3313 17 3 5 1665479 3 +10000000000000000000010011101101 3 2 5 2 7 2 3 2 11 +10000000000000000000010011101001 5 29 71 79 227233 5 7 11173 30747889 +10000000000000000000010011100111 3 2 5 2 7 2 3 2 11 +10000000000000000000010011100101 36899 5 89 7 590907929 479 5 61 19 +10000000000000000000010011100001 3 2 3 2 7 2 3 2 3 +10000000000000000000010011011111 5 233 3 4994369 269 3 3041 9347977486283 3 +10000000000000000000010011011101 479 2 7 2 216304623163 2 5 2 191 +10000000000000000000010011011011 3 2 5 2 7 2 3 2 11 +10000000000000000000010011010101 3 37 313 3 11 5 3 7 665501 +10000000000000000000010011010011 113 1249747 11 7 17 168958150321 7 31 127 +10000000000000000000010011010001 277 2 3 2 349 2 61 2 3 +10000000000000000000010011001111 3 2 5 2 7 2 3 2 11 +10000000000000000000010011001011 5 7 598393493 677 213541543 5 7 13 7 +10000000000000000000010011001001 3 2 3 2 7 2 3 2 3 +10000000000000000000010011000011 3 2 3 2 7 2 3 2 3 +10000000000000000000010011000001 5 31 7 7 5 5 345811 71 103 +10000000000000000000010010111111 17 2543 3 5197 283 3 37 1627 3 +10000000000000000000010010111101 3 2 5 2 7 2 3 2 7 +10000000000000000000010010110111 3 2 5 2 7 2 3 2 11 +10000000000000000000010010110101 907 1699 7 37 108988823 11 7 2142449 107 +10000000000000000000010010110001 3 2 3 2 7 2 3 2 3 +10000000000000000000010010101101 5 167 3257 563 13 5 7 71 1399 +10000000000000000000010010101001 6673 2 3 2 11 2 29 2 3 +10000000000000000000010010100101 3 2 3 2 7 2 3 2 3 +10000000000000000000010010100011 5 2 3 2 37 2 5 2 3 +10000000000000000000010010100001 13 378593 43609 11 5 10007 11 659 383 +10000000000000000000010010011111 3 2 5 2 7 2 3 2 11 +10000000000000000000010010011011 89 5 227 17 677 17 5 317 61 +10000000000000000000010010011001 3 2 3 2 7 2 3 2 3 +10000000000000000000010010010111 11 17 47 26069784863 452737091 467 7 11 173 +10000000000000000000010010010011 3 2 3 2 7 2 3 2 3 +10000000000000000000010010001101 3 2 3 2 7 2 3 2 3 +10000000000000000000010010000111 3 2 3 2 7 2 3 2 3 +10000000000000000000010010000001 3 2 5 2 7 2 3 2 11 +10000000000000000000010001111111 347 791387 3 613 79 3 13139299 25943 3 +10000000000000000000010001111011 3 2 5 2 7 2 3 2 11 +10000000000000000000010001110101 3 11 578401 3 59 277 3 4093 59 +10000000000000000000010001110011 7 7 47 17 139 11 7 7 7 +10000000000000000000010001110001 5 2 3 2 37 2 5 2 3 +10000000000000000000010001101111 3 2 5 2 7 2 3 2 11 +10000000000000000000010001101001 3 2 3 2 7 2 3 2 3 +10000000000000000000010001100101 7 2 3 2 43 2 73 2 3 +10000000000000000000010001100011 3 2 3 2 7 2 3 2 3 +10000000000000000000010001100001 23 7 11 1890300761 5 589349 347 43 7 +10000000000000000000010001011101 3 7 13 3 31 5 3 73 7 +10000000000000000000010001011001 17 2 3 2 29 2 17 2 3 +10000000000000000000010001010111 3 2220671 11 3 29 378389971 3 7 113 +10000000000000000000010001010101 11 2 3 2 1861 2 23 2 3 +10000000000000000000010001010011 5 2 3 2 13 2 5 2 3 +10000000000000000000010001010001 3 71 7 3 5 257 3 4943 257 +10000000000000000000010001001101 571 2 3 2 9397 2 379 2 3 +10000000000000000000010001001011 3 2 3 2 7 2 3 2 3 +10000000000000000000010001001001 5 87517 3186451 97 5 5 599 7 335753113 +10000000000000000000010001000111 509 2 3 2 11 2 307853701537 2 3 +10000000000000000000010001000011 163 11 7 7 5 37 77569 269 17 +10000000000000000000010001000001 67 2 61 2 47413790603 2 26757673 2 14347 +10000000000000000000010000111111 3 2 5 2 7 2 3 2 7 +10000000000000000000010000111001 3 2 3 2 7 2 3 2 3 +10000000000000000000010000110111 17 11 7 79 13 79 7 317 23 +10000000000000000000010000110101 5 2 3 2 37 2 5 2 3 +10000000000000000000010000110011 3 2 3 2 7 2 3 2 3 +10000000000000000000010000101101 3 2 3 2 7 2 3 2 3 +10000000000000000000010000101011 5 2 3 2 37 2 5 2 3 +10000000000000000000010000101001 11 11 19 1579 5 41 211 11551 19 +10000000000000000000010000100111 3 2 3 2 7 2 3 2 3 +10000000000000000000010000100011 5869 359 11 23 5 18124666163 24918503 311 76221914995147 +10000000000000000000010000100001 3 2 5 2 7 2 3 2 11 +10000000000000000000010000011111 7 37 193073 197 11 23 7 7 1402627839439063 +10000000000000000000010000011101 149 2 3 2 13 2 3701 2 3 +10000000000000000000010000011011 3 2 3 2 7 2 3 2 3 +10000000000000000000010000010111 5 2 3 2 19 2 5 2 3 +10000000000000000000010000010101 3 7 13 3 5 43 3 73 7 +10000000000000000000010000001111 3 2 3 2 7 2 3 2 3 +10000000000000000000010000001001 3 2 5 2 7 2 3 2 7 +10000000000000000000010000000101 13 2 11 2 11 2 141425657 2 5978031439 +10000000000000000000010000000011 3 2 5 2 7 2 3 2 11 +10000000000000000000010000000001 71 59 3 17 191 3 1789 11 3 +10000000000000000000001111111101 3 2 5 2 5 2 3 2 11 +10000000000000000000001111111011 2543 2 317 2 5 2 43 2 31 +10000000000000000000001111111001 5 19 3 47 383 3 3319 1201 3 +10000000000000000000001111110111 3 2 5 2 5 2 3 2 11 +10000000000000000000001111110101 7 13 3 31 43 3 73 7 3 +10000000000000000000001111110001 3 2 5 2 7 2 3 2 11 +10000000000000000000001111101111 5 2 17 2 5 2 5 2 13 +10000000000000000000001111101001 89 2 19 2 137 2 4507567703 2 67 +10000000000000000000001111100111 7 13 3 31 17 3 73 7 3 +10000000000000000000001111100101 3 2 5 2 7 2 3 2 11 +10000000000000000000001111100011 9941 2 13 2 79 2 11 2 23 +10000000000000000000001111011111 3 2 5 2 5 2 3 2 11 +10000000000000000000001111011101 28603 5 3 37 5515143173 3 5 21701 3 +10000000000000000000001111011011 5 101 3 7 251815147469 3 11 4549 3 +10000000000000000000001111011001 3 2 5 2 7 2 3 2 11 +10000000000000000000001111010111 23 21787 3 11 11 3 71 4008190550933 3 +10000000000000000000001111010101 43 2 97 2 6067 2 503 2 251 +10000000000000000000001111010011 3 2 5 2 7 2 3 2 11 +10000000000000000000001111001111 31379 17 3 981493 41 3 19 3049 3 +10000000000000000000001111001101 3 2 5 2 7 2 3 2 11 +10000000000000000000001111001011 7 2 1062343 2 1019 2 2729 2 13 +10000000000000000000001111000111 3 2 5 2 7 2 3 2 7 +10000000000000000000001111000001 3 2 3 2 7 2 3 2 3 +10000000000000000000001110111111 31 2 11 2 5 2 31 2 7 +10000000000000000000001110111101 5 13 3 23 13 3 73 7 3 +10000000000000000000001110111011 3 24247 3 3 81411731593 3 3 947 3 +10000000000000000000001110110111 13 5 3 7 601 3 5 4051 3 +10000000000000000000001110110101 3 2 5 2 7 2 3 2 11 +10000000000000000000001110101111 3 13 3 3 43 3 3 7 3 +10000000000000000000001110101101 197 2 2729 2 47 2 53 2 7 +10000000000000000000001110101011 457 2 691 2 11 2 4463 2 1531 +10000000000000000000001110100111 25031 2 686485573 2 151 2 22225417 2 13 +10000000000000000000001110100011 3 5 41 3 673 2819 3 1051 54449 +10000000000000000000001110100001 7 2 3 2 43 2 11 2 3 +10000000000000000000001110011101 3 2 5 2 7 2 3 2 11 +10000000000000000000001110011011 79 2 7 2 397 2 5 2 7 +10000000000000000000001110010111 3 2 5 2 7 2 3 2 11 +10000000000000000000001110010001 3 2 3 2 7 2 3 2 3 +10000000000000000000001110001111 11 2 20981 2 4967 2 487 2 10957 +10000000000000000000001110001011 3 62627 167 3 23 5 3 42835972873 116245674241 +10000000000000000000001110000101 3 2 3 2 7 2 3 2 3 +10000000000000000000001110000011 13 2 3 2 17 2 97 2 3 +10000000000000000000001110000001 5 11 11 7 5 5 31 11 41 +10000000000000000000001101111111 3 2 5 2 5 2 3 2 11 +10000000000000000000001101111011 23 5 3 1877189 17 3 5 5695143491 3 +10000000000000000000001101111001 3 2 5 2 7 2 3 2 7 +10000000000000000000001101110111 5 11 3 31 23 3 11 7 3 +10000000000000000000001101110101 4877 2 23 2 337 2 919 2 31 +10000000000000000000001101110011 3 2 5 2 7 2 3 2 11 +10000000000000000000001101110001 127 5 43 19531 13 29 5 11 239 +10000000000000000000001101101101 3 2 5 2 7 2 3 2 11 +10000000000000000000001101101011 17 2 1789 2 297617 2 31 2 177917 +10000000000000000000001101101001 7 11 33827 149 89 67 7 7 273629 +10000000000000000000001101100111 3 2 5 2 7 2 3 2 11 +10000000000000000000001101100011 5 7 103 151 503 5 7 17 7 +10000000000000000000001101100001 3 2 3 2 7 2 3 2 3 +10000000000000000000001101011111 41 7 3 29 59 3 17 37 3 +10000000000000000000001101011101 359 2 73 2 2394109 2 461 2 211730688480127 +10000000000000000000001101011011 3 2 5 2 7 2 3 2 11 +10000000000000000000001101011001 5 7481531 7 1913 29 5 7 29 163 +10000000000000000000001101010111 38903 2 11 2 17 2 389 2 157 +10000000000000000000001101010101 3 127 7901 3 433 31 3 587 199 +10000000000000000000001101010001 30757 2 3 2 107 2 41 2 3 +10000000000000000000001101001111 3 2 5 2 7 2 3 2 11 +10000000000000000000001101001001 3 2 3 2 7 2 3 2 3 +10000000000000000000001101000111 271 359 478139 17 6146159 245471 7 2803 13 +10000000000000000000001101000101 5 2 3 2 37 2 5 2 3 +10000000000000000000001101000011 3 2 3 2 7 2 3 2 3 +10000000000000000000001101000001 19 229 347 17627 5 311 7057 17 283 +10000000000000000000001100111111 7 5 3 31 43 3 5 7 3 +10000000000000000000001100111101 3 2 5 2 7 2 3 2 11 +10000000000000000000001100111011 5 2 47 2 11290501 2 29 2 1869737 +10000000000000000000001100111001 47 139 23 11 19 8623 7 265494228989159 109 +10000000000000000000001100110111 3 2 5 2 7 2 3 2 11 +10000000000000000000001100110011 877 4945103 349 13 223 1213 7 11 79 +10000000000000000000001100110001 3 2 3 2 7 2 3 2 3 +10000000000000000000001100101111 373 2 883 2 19 2 787489 2 7 +10000000000000000000001100101011 3 5 2027 3 109 11 3 19 1769777 +10000000000000000000001100100111 5 5031833 61 7 38093477 5 7 191 32911 +10000000000000000000001100100101 3 2 3 2 7 2 3 2 3 +10000000000000000000001100100011 7 2 3 2 43 2 73 2 3 +10000000000000000000001100100001 11 5 37 14543 5 31 5 126037 151 +10000000000000000000001100011111 3 2 5 2 7 2 3 2 11 +10000000000000000000001100011101 5 224669 331 7 131927 5 7 103 709 +10000000000000000000001100011011 13 73 11 53 13 13 7 6481 313 +10000000000000000000001100011001 3 2 3 2 7 2 3 2 3 +10000000000000000000001100010101 7 2 3 2 43 2 43 2 3 +10000000000000000000001100010011 3 2 3 2 7 2 3 2 3 +10000000000000000000001100001101 3 2 3 2 7 2 3 2 3 +10000000000000000000001100001011 11 2 3 2 53 2 479 2 3 +10000000000000000000001100000111 3 2 3 2 7 2 3 2 3 +10000000000000000000001100000101 17 7 11 11 5 23 31 11 7 +10000000000000000000001100000001 3 2 5 2 7 2 3 2 11 +10000000000000000000001011111111 5 2 17 2 5 2 5 2 101 +10000000000000000000001011111011 3 11 3 3 2521 3 3 83 3 +10000000000000000000001011111001 7 2 1530791929 2 41 2 43 2 20897 +10000000000000000000001011110101 3 2 5 2 7 2 3 2 11 +10000000000000000000001011110011 37 2 7 2 59333 2 311 2 5273 +10000000000000000000001011101111 3 627559 3 3 211 3 3 337 3 +10000000000000000000001011101101 8713 2 9003233 2 13 2 916469 2 16547148641557 +10000000000000000000001011101011 5 2 17 2 37 2 5 2 7 +10000000000000000000001011101001 3 6173 7 3 19 17 3 1051682071351 1049 +10000000000000000000001011100111 13 2 13 2 23 2 97 2 19 +10000000000000000000001011100001 5 2 3 2 37 2 5 2 3 +10000000000000000000001011011101 3 2 5 2 7 2 3 2 11 +10000000000000000000001011011011 47 2 11 2 11 2 6101 2 47 +10000000000000000000001011010111 3 2 5 2 7 2 3 2 11 +10000000000000000000001011010011 43 7 107 1097 103 4561 7 13 7 +10000000000000000000001011010001 3 2 3 2 7 2 3 2 3 +10000000000000000000001011001001 11 2 3 2 691 2 131 2 3 +10000000000000000000001011000111 31 263 2269 199 137 349 7 29 71 +10000000000000000000001011000101 3 2 3 2 7 2 3 2 3 +10000000000000000000001011000011 5 2 3 2 37 2 5 2 3 +10000000000000000000001010111011 41 2 7 2 3359 2 3769 2 1628779 +10000000000000000000001010111001 3 7 13 3 13 5 3 73 7 +10000000000000000000001010110111 233 2 193 2 211 2 17 2 182443 +10000000000000000000001010110101 307 997 11 383 43049 17377 7 17 829 +10000000000000000000001010110011 3 5 269 3 72047 23 3 7 181 +10000000000000000000001010101111 5 2 17 2 37 2 5 2 101 +10000000000000000000001010101001 19 2 3 2 7537877329 2 601 2 3 +10000000000000000000001010100111 3 41 149 3 59 11 3 11 23 +10000000000000000000001010100101 5 2 3 2 37 2 5 2 3 +10000000000000000000001010100011 37369 2 3 2 11 2 29 2 3 +10000000000000000000001010100001 3 9643 73 3 5 307 3 5876116040177 29 +10000000000000000000001010011111 17 2 7 2 3389 2 1283 2 7 +10000000000000000000001010011101 11 5 1019 173 22501 23 5 163 23 +10000000000000000000001010011011 3 79 137350597 3 17 5 3 13 59 +10000000000000000000001010011001 13 2 3 2 11 2 765827 2 3 +10000000000000000000001010010101 3 2 3 2 7 2 3 2 3 +10000000000000000000001010001101 59 2 3 2 211 2 11 2 3 +10000000000000000000001010001011 2579 2 3 2 15137 2 317 2 3 +10000000000000000000001010001001 3 5 11 3 5 13 3 7 41 +10000000000000000000001010000111 5 2 3 2 19 2 5 2 3 +10000000000000000000001010000101 89 41 463 7 5 31 29 37 1033 +10000000000000000000001010000011 3 19 7 3 5 11551 3 530713 19 +10000000000000000000001010000001 73 2 1999 2 149 2 41 2 149 +10000000000000000000001001111111 13 11 3 17 5261 3 120779 222991 3 +10000000000000000000001001111101 3 2 5 2 7 2 3 2 7 +10000000000000000000001001111011 7 2 1609 2 2131 2 733 2 157 +10000000000000000000001001110111 3 2 5 2 7 2 3 2 11 +10000000000000000000001001110011 5 1093 43 19 467 5 7 547 239 +10000000000000000000001001110001 3 2 3 2 7 2 3 2 3 +10000000000000000000001001101011 3 161753 7 3 8707 107 3 239 29 +10000000000000000000001001101001 5 2 3 2 37 2 5 2 3 +10000000000000000000001001100111 23 5 11 97 11 1342181 5 37 7 +10000000000000000000001001100101 3 2 3 2 7 2 3 2 3 +10000000000000000000001001011111 3 2 5 2 7 2 3 2 11 +10000000000000000000001001011101 19 17 7 29 11 8353 7 6569 31 +10000000000000000000001001011011 11 13 31 1546837 293 37 7 43 53 +10000000000000000000001001011001 3 2 3 2 7 2 3 2 3 +10000000000000000000001001010111 71 19 11927527 613 4249438069 17 7 3931 41 +10000000000000000000001001010101 5 2 3 2 19 2 5 2 3 +10000000000000000000001001010011 3 2 3 2 7 2 3 2 3 +10000000000000000000001001010001 7 509 290137 2467 5 47 179 7 631 +10000000000000000000001001001101 3 2 3 2 7 2 3 2 3 +10000000000000000000001001001011 5 2 3 2 13 2 5 2 3 +10000000000000000000001001000111 3 2 3 2 7 2 3 2 3 +10000000000000000000001001000011 7 7 227 809 5 89 43 7 7 +10000000000000000000001001000001 3 2 5 2 7 2 3 2 11 +10000000000000000000001000111011 3 5 13 3 31 43 3 11 7 +10000000000000000000001000111001 17 2 3 2 557 2 17 2 3 +10000000000000000000001000110111 5 17 19 11 17 5 7 34273 128081543 +10000000000000000000001000110101 3 2 3 2 7 2 3 2 3 +10000000000000000000001000110011 1949 2 3 2 197 2 229 2 3 +10000000000000000000001000110001 13 5 265662937 83 5 4127381 5 27944235563 2631712469409613 +10000000000000000000001000101111 3 131 1009 3 13 1525192728623 3 76249 379 +10000000000000000000001000101101 5 2 3 2 37 2 5 2 3 +10000000000000000000001000101001 3 7 13 3 5 23 3 37 7 +10000000000000000000001000100111 7 2 3 2 43 2 73 2 3 +10000000000000000000001000100011 3 31 1097 3 5 5 3 53 31 +10000000000000000000001000011101 3 2 3 2 7 2 3 2 3 +10000000000000000000001000011011 6421 2 3 2 269 2 7333 2 3 +10000000000000000000001000010111 3 2 3 2 7 2 3 2 3 +10000000000000000000001000010101 37 43891 23 281 5 26701 269 19 2185215679 +10000000000000000000001000010001 3 2 5 2 7 2 3 2 7 +10000000000000000000001000001111 5 2 3 2 37 2 5 2 3 +10000000000000000000001000001101 31 11 11 11 5 17 31 11 41 +10000000000000000000001000001011 3 17 131 3 5 30043748821 3 7 43 +10000000000000000000001000001001 8849 2 7 2 19427 2 11 2 17 +10000000000000000000001000000101 3 2 5 2 7 2 3 2 11 +10000000000000000000001000000011 11 2 409 2 191 2 1966628094427 2 2539 +10000000000000000000000111111111 3 2 5 2 5 2 3 2 11 +10000000000000000000000111111101 7 5 3 31 43 3 5 7 3 +10000000000000000000000111111001 3 2 5 2 7 2 3 2 11 +10000000000000000000000111110101 17 2 29 2 1979 2 113 2 7 +10000000000000000000000111110011 3 2 5 2 7 2 3 2 11 +10000000000000000000000111101111 7 13 3 19 19 3 17 7 3 +10000000000000000000000111101101 3 2 5 2 7 2 3 2 11 +10000000000000000000000111101011 19 2 13 2 13163 2 23 2 41 +10000000000000000000000111101001 461 5 11 29 1817502473 5059 5 43 7 +10000000000000000000000111100111 3 2 5 2 7 2 3 2 11 +10000000000000000000000111100101 29 53 13 11 17 21787 7 1823 19423 +10000000000000000000000111100001 3 2 3 2 7 2 3 2 3 +10000000000000000000000111011111 1051 5 3 17 1237 3 5 83 3 +10000000000000000000000111011011 3 2 5 2 7 2 3 2 11 +10000000000000000000000111010101 3 5 19 3 29 2515968509 3 16561 23 +10000000000000000000000111010011 5 19 13 61 41 5 7 7 2069 +10000000000000000000000111010001 43 2 3 2 11 2 1064303831 2 3 +10000000000000000000000111001111 3 2 5 2 7 2 3 2 7 +10000000000000000000000111001001 3 2 3 2 7 2 3 2 3 +10000000000000000000000111000111 977 11 29 421 11 131 7 337 17 +10000000000000000000000111000101 7 2 3 2 43 2 73 2 3 +10000000000000000000000111000011 3 2 3 2 7 2 3 2 3 +10000000000000000000000111000001 11 5 13 43 5 29 5 23 19 +10000000000000000000000110111101 3 2 5 2 7 2 3 2 11 +10000000000000000000000110111001 283 83 89 7099719413 4618069 10834973 7 19 1483 +10000000000000000000000110110111 3 2 5 2 7 2 3 2 11 +10000000000000000000000110110001 3 2 3 2 7 2 3 2 3 +10000000000000000000000110101111 13 2 7211 2 53 2 17183 2 13 +10000000000000000000000110101001 7 2 3 2 43 2 73 2 3 +10000000000000000000000110100101 3 2 3 2 7 2 3 2 3 +10000000000000000000000110100011 67 2 3 2 13 2 59 2 3 +10000000000000000000000110100001 5 7 19 1783 5 5 4517 29 7 +10000000000000000000000110011111 3 2 5 2 7 2 3 2 11 +10000000000000000000000110011011 7 23 6043 7 1063 29 7 7 35157907826831 +10000000000000000000000110011001 3 2 3 2 7 2 3 2 3 +10000000000000000000000110010111 5 41 7 89 19 5 7 53003 13 +10000000000000000000000110010101 11 2 3 2 79 2 23 2 3 +10000000000000000000000110010011 3 2 3 2 7 2 3 2 3 +10000000000000000000000110010001 31 11 11 11 5 2801 13 11 41 +10000000000000000000000110001101 3 2 3 2 7 2 3 2 3 +10000000000000000000000110000111 3 2 3 2 7 2 3 2 3 +10000000000000000000000110000011 5 41131 172849 353 5 5 7873 227 193 +10000000000000000000000110000001 3 2 5 2 7 2 3 2 11 +10000000000000000000000101111111 7 13 3 31 43 3 43 7 3 +10000000000000000000000101111011 3 2 5 2 7 2 3 2 11 +10000000000000000000000101110111 199 2 967 2 11 2 1312584319 2 7 +10000000000000000000000101110101 3 19 43 3 89 13 3 167 239 +10000000000000000000000101110001 7 2 3 2 43 2 29 2 3 +10000000000000000000000101101111 3 2 5 2 7 2 3 2 11 +10000000000000000000000101101011 2377 7 29 17 13 313 7 10504561 7 +10000000000000000000000101101001 3 2 3 2 7 2 3 2 3 +10000000000000000000000101100101 5 2 3 2 37 2 5 2 3 +10000000000000000000000101100011 3 2 3 2 7 2 3 2 3 +10000000000000000000000101011101 3 5 197 3 3389557 41 3 293 5813 +10000000000000000000000101010111 3 44741 151 3 18022141 4789 3 23 31 +10000000000000000000000101010101 7 2 3 2 17 2 71 2 3 +10000000000000000000000101010011 11 2 3 2 29 2 8531281734953 2 3 +10000000000000000000000101001011 3 2 3 2 7 2 3 2 3 +10000000000000000000000101001001 103 5 17569 23 5 17 5 31 8230109 +10000000000000000000000101000111 5 2 3 2 13 2 5 2 3 +10000000000000000000000101000011 6379 211 11 149 5 22383059 79 17 43 +10000000000000000000000100111111 3 2 5 2 7 2 3 2 11 +10000000000000000000000100111101 5 105499 29 47 41 5 7 101 17 +10000000000000000000000100111001 3 2 3 2 7 2 3 2 3 +10000000000000000000000100110101 439 2 3 2 11 2 491 2 3 +10000000000000000000000100110011 3 2 3 2 7 2 3 2 3 +10000000000000000000000100101101 3 2 3 2 7 2 3 2 3 +10000000000000000000000100101011 7 2 3 2 43 2 73 2 3 +10000000000000000000000100101001 5 239 2711 131 5 5 199 113 359 +10000000000000000000000100100111 3 2 3 2 7 2 3 2 3 +10000000000000000000000100100101 23 79 67 19085800207 5 53 11 43 4956691 +10000000000000000000000100100011 79 5 113369981 89 5 1697 5 167 7 +10000000000000000000000100100001 3 2 5 2 7 2 3 2 11 +10000000000000000000000100011111 5 7 17273329 67 498313679 5 7 7759 7 +10000000000000000000000100011101 7 2 3 2 43 2 11 2 3 +10000000000000000000000100011011 3 2 3 2 7 2 3 2 3 +10000000000000000000000100010111 2293 2 3 2 383 2 5749484340869 2 3 +10000000000000000000000100010101 3 11 11 3 5 5 3 11 41 +10000000000000000000000100010011 13 47 163 131 5 13 37 647 47 +10000000000000000000000100010001 11 2 191 2 89 2 5 2 113 +10000000000000000000000100001111 3 2 3 2 7 2 3 2 3 +10000000000000000000000100001101 101 5 19 41 5 3819353 5 13313753 7 +10000000000000000000000100001001 3 2 5 2 7 2 3 2 11 +10000000000000000000000100000111 17 27941 471267323 1133938703 5 3432135533 157 19 13 +10000000000000000000000100000101 47 2 383 2 19 2 350429 2 103 +10000000000000000000000100000011 3 2 5 2 7 2 3 2 11 +10000000000000000000000100000001 5 13 3 31 11 3 17 7 3 +10000000000000000000000011111111 28619 7 3 37 11 3 41 69627165436663 3 +10000000000000000000000011111101 3 2 5 2 7 2 3 2 11 +10000000000000000000000011111011 11 2 7 2 13 2 1787 2 8101 +10000000000000000000000011110111 3 2 5 2 7 2 3 2 11 +10000000000000000000000011110011 7 139 11 151 132667 13 7 7 13 +10000000000000000000000011110001 3 2 3 2 7 2 3 2 3 +10000000000000000000000011101101 5 7 5861 11 5483 5 7 23 7 +10000000000000000000000011101011 3 17 269 3 17 14813 3 5077 443 +10000000000000000000000011100101 3 2 3 2 7 2 3 2 3 +10000000000000000000000011100011 5 2 3 2 37 2 5 2 3 +10000000000000000000000011100001 19 1433 149 17 5 7883 947 17 13 +10000000000000000000000011011111 3 2 5 2 7 2 3 2 11 +10000000000000000000000011011001 3 2 3 2 7 2 3 2 3 +10000000000000000000000011010111 7 11953 13 171207227 13 11 7 7 342253573 +10000000000000000000000011010101 191 2 3 2 173 2 37 2 3 +10000000000000000000000011010011 3 2 3 2 7 2 3 2 3 +10000000000000000000000011001111 5 11 199 2676022103 109 5 7 107 2549 +10000000000000000000000011001101 3 2 3 2 7 2 3 2 3 +10000000000000000000000011001011 73 2 3 2 11 2 1789 2 3 +10000000000000000000000011000111 3 2 3 2 7 2 3 2 3 +10000000000000000000000011000011 17 337 7 4261 5 17 11 29 1751477323787 +10000000000000000000000011000001 3 2 5 2 7 2 3 2 11 +10000000000000000000000010111111 53 2 41 2 743025642547 2 16229 2 3947 +10000000000000000000000010111101 157 5 18143 8131644991 11 17 5 5838353 269 +10000000000000000000000010111011 3 353 491 3 809 5 3 7 22060567 +10000000000000000000000010111001 11 2 3 2 28723 2 23 2 3 +10000000000000000000000010110111 2207 7 7 83 67 241 7 11 7 +10000000000000000000000010110101 3 2 3 2 7 2 3 2 3 +10000000000000000000000010110011 11197 2 3 2 307 2 11 2 3 +10000000000000000000000010110001 5 23 607 269 5 5 41 43 19 +10000000000000000000000010101101 7 2 3 2 43 2 73 2 3 +10000000000000000000000010101011 13 2 3 2 349 2 25237 2 3 +10000000000000000000000010100111 5 2 3 2 37 2 5 2 3 +10000000000000000000000010100011 3 1429 463 3 5 41 3 541 17 +10000000000000000000000010100001 17 2 11 2 19 2 599 2 81015785899 +10000000000000000000000010011101 3 2 3 2 7 2 3 2 3 +10000000000000000000000010011011 23 2 3 2 179 2 138490739 2 3 +10000000000000000000000010011001 31 11 7 11 5 37 31 11 41 +10000000000000000000000010010111 3 2 3 2 7 2 3 2 3 +10000000000000000000000010010101 19 5 223 19 5 11 5 17 7417 +10000000000000000000000010010011 5 7 887 53 5 5 239 71 7 +10000000000000000000000010010001 3 2 5 2 7 2 3 2 11 +10000000000000000000000010001111 359 2 3 2 13 2 61 2 3 +10000000000000000000000010001001 5 2 2179 2 11 2 167 2 23 +10000000000000000000000010000101 3 2 5 2 7 2 3 2 11 +10000000000000000000000010000011 7 2 13 2 593 2 157 2 28031 +10000000000000000000000001111111 3 2 5 2 7 2 3 2 11 +10000000000000000000000001111101 41 7013 167 17 2617 97 7 83 5887084391 +10000000000000000000000001111001 3 2 3 2 7 2 3 2 3 +10000000000000000000000001110111 11 1093 11 7 53 29 7 547 239 +10000000000000000000000001110101 5 2 3 2 37 2 5 2 3 +10000000000000000000000001110011 3 2 3 2 7 2 3 2 3 +10000000000000000000000001101111 19 7 67 41 733 13 7 71 7 +10000000000000000000000001101101 3 2 3 2 7 2 3 2 3 +10000000000000000000000001101011 5 2 3 2 23 2 5 2 3 +10000000000000000000000001100111 3 2 3 2 7 2 3 2 3 +10000000000000000000000001100011 1933 11 1483423 127 5 1013 41 23 13 +10000000000000000000000001100001 3 2 5 2 7 2 3 2 11 +10000000000000000000000001011101 13 2 3 2 71 2 17 2 3 +10000000000000000000000001011011 3 2 3 2 7 2 3 2 3 +10000000000000000000000001011001 7 5 43992547 29 5 104717 5 7 8221 +10000000000000000000000001010111 5 2 3 2 37 2 5 2 3 +10000000000000000000000001010011 181 29 7 7 5 11 65867307941 11 4559837 +10000000000000000000000001001111 3 2 3 2 7 2 3 2 3 +10000000000000000000000001001011 7 7 11 223 5 103 113 7 7 +10000000000000000000000001001001 3 2 5 2 7 2 3 2 11 +10000000000000000000000001000111 709 17 13 293 5 263 2663 137 67 +10000000000000000000000001000101 373 2 563 2 10691179 2 139 2 7 +10000000000000000000000001000011 3 2 5 2 7 2 3 2 11 +10000000000000000000000000111101 3 2 3 2 7 2 3 2 3 +10000000000000000000000000111011 17 2 3 2 1297 2 17 2 3 +10000000000000000000000000111001 5 317 47 23 5 5 83 523 23 +10000000000000000000000000110111 3 2 3 2 7 2 3 2 3 +10000000000000000000000000110001 3 2 5 2 7 2 3 2 11 +10000000000000000000000000101111 5 2 3 2 11 2 5 2 3 +10000000000000000000000000101011 3 163 19 3 5 151 3 149 1723 +10000000000000000000000000101001 13 2 24989 2 19571 2 59 2 2662067 +10000000000000000000000000100101 3 2 5 2 7 2 3 2 11 +10000000000000000000000000100011 19 2 89 2 17 2 1180877 2 36473 +10000000000000000000000000100001 7 13 3 31 41 3 73 7 3 +10000000000000000000000000011111 3 2 3 2 7 2 3 2 3 +10000000000000000000000000011101 31 5 11 11 5 419 5 11 41 +10000000000000000000000000011001 3 2 5 2 7 2 3 2 7 +10000000000000000000000000010101 29 2 397 2 193 2 11 2 13513 +10000000000000000000000000010011 3 2 5 2 7 2 3 2 11 +10000000000000000000000000010001 5 67 3 43 4423 3 6197 127 3 +10000000000000000000000000001111 13 149 197123 7 5 11 859 479 1021 +10000000000000000000000000001101 3 2 5 2 7 2 3 2 11 +10000000000000000000000000001001 11 5 3 67 1152846547 3 5 89 3 +10000000000000000000000000000111 3 2 5 2 7 2 3 2 11 +10000000000000000000000000000101 7 13 3 31 43 3 73 7 3 +10000000000000000000000000000011 83 7 3 11 23 3 569 173 3 +10000000000000000000000000000001 3 2 5 2 7 2 3 2 11 diff --git a/codejam/2016-qualification/c-3.in.disabled b/codejam/2016-qualification/c-3.in.disabled new file mode 100644 index 00000000..17c6dcc8 --- /dev/null +++ b/codejam/2016-qualification/c-3.in.disabled @@ -0,0 +1,2 @@ +1 +32 500 diff --git a/codejam/2016-qualification/c.rkt b/codejam/2016-qualification/c.rkt new file mode 100755 index 00000000..d718c5b2 --- /dev/null +++ b/codejam/2016-qualification/c.rkt @@ -0,0 +1,34 @@ +#!/usr/bin/env racket +;; https://codingcompetitions.withgoogle.com/codejam/round/0000000000201bee/0000000000201b6d +#lang racket +(require math/number-theory) + +(define (process n j) + (define (collect i s) + (cons (format "~b" i) + (map (lambda (x) + (number->string (second (divisors (string->number s x))))) + (range 2 11)))) + (define (no-primes? s) + (define (iter i) + (cond ([> i 10] #t) + ([prime? (string->number s i)] #f) + (else (iter (+ i 1))))) + (iter 2)) + (define (iter i k xs) + (if (= k j) + xs + (let ([s (format "~b" i)]) + (if (no-primes? s) + (iter (+ i 2) (+ k 1) (cons (collect i s) xs)) + (iter (+ i 2) k xs))))) + (iter (+ (expt 2 (- n 1)) 1) 0 '())) + +(define (main n) + (define (iter i) + (when (<= i n) + (printf "Case #~a:\n" i) + (for-each (lambda (x) (printf "~a\n" (string-join x))) + (apply process (map string->number (string-split (read-line))))))) + (iter 1)) +(main (string->number (read-line))) diff --git a/codejam/README.md b/codejam/README.md index d4004530..b3ca7b2c 100644 --- a/codejam/README.md +++ b/codejam/README.md @@ -52,6 +52,8 @@ There are solutions for the following [Google Code Jam](https://codejam.withgoog ([problem site](https://codingcompetitions.withgoogle.com/codejam/round/00000000002017f7/0000000000201878)) 1. [2017 Qualification Round - A. Oversized Pancake Flipper](2017-qualification/a.py) ([problem site](https://codingcompetitions.withgoogle.com/codejam/round/00000000002017f7/0000000000201847)) +1. [2016 Qualification Round - C. Coin Jam](2016-qualification/c.rkt) + ([problem site](https://codingcompetitions.withgoogle.com/codejam/round/0000000000201bee/0000000000201b6d)) 1. [2016 Qualification Round - B. Revenge of the Pancakes](2016-qualification/b.ml) ([problem site](https://codingcompetitions.withgoogle.com/codejam/round/0000000000201bee/0000000000201d17)) 1. [2016 Qualification Round - A. Counting Sheep](2016-qualification/a.rkt)