From: Neil Smith Date: Fri, 16 Jun 2017 09:03:53 +0000 (+0100) Subject: Added Java solutions from Anton X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=b39e05e955bfcbc82abd31571d4cff37021b5942;p=ou-summer-of-code-2017.git Added Java solutions from Anton --- diff --git a/anton/SummerOfCode/00-prices.txt b/anton/SummerOfCode/00-prices.txt new file mode 100644 index 0000000..3d88183 --- /dev/null +++ b/anton/SummerOfCode/00-prices.txt @@ -0,0 +1,124 @@ +d77b1148 1396 Mamula 579 +42e05169e 1104 Jayuya 476 +a6538cfa970 1100 Parowan 661 +90409a70 1143 Parowan 679 +18e93a0f0c 918 Ijsseloog 560 +2781c13abc2 1057 Tubakuba 561 +e3790f1484 1682 Giessenmestia 448 +25a2c3799a 1340 Sukhumi 709 +f38f75c8e4e 1319 Mora 685 +0b4b44db1d 1089 Holmegaard 591 +0afe71e09d 1276 Stonington-Island 640 +627824317b47 909 Giessenmestia 532 +83a7d0bbd1 1225 Aalborg 689 +f3c42695 1241 Nordkapp 751 +cdd546172 1221 Puente-Laguna-Garzonkuala-Penyu 593 +71772664d35c 1205 Geoje-Si 615 +66ffcd848 974 Nullarbor 707 +2b11e359e8f9 1488 Brorfelde 613 +0dc258d3e 1164 Tubakuba 596 +3bc5b60c2a5 1231 Nullarbor 517 +cd563561 1136 Nordkapp 634 +1c5f5ecd6a 1332 Holmegaard 615 +8255b281 1302 Sukhumi 542 +03478ddc6 1119 Hajnowski 599 +763db1eb6980 944 Geoje-Si 707 +4b9291505 1230 Giessenmestia 648 +1634bfe2408 1264 Giessenmestia 460 +f793130d4b2d 1473 Nordkapp 595 +a3169c6312 1364 Sofia 631 +00f15d691e2c 1205 Estacada 487 +94d98461f6 1179 Almaty 496 +f02bc3375 1225 Tubakuba 569 +616a27c7 942 Brorfelde 639 +a86f98f6d8 1388 Karlukovo 524 +44e58004d2 1206 Karlukovo 526 +9557b5625e4 1242 Puente-Laguna-Garzonkuala-Penyu 622 +d4ab30071b 895 Nullarbor 589 +a46da8767867 1281 Sofia 598 +b450fed871 1244 Luoyang 584 +04f3f57cda 1321 Grimsey-Island 631 +d7bcc37c902b 1127 Giessenmestia 520 +2a57e5b6bff 1203 Geoje-Si 624 +ca574abd1d59 1201 Zhangye-Shi 559 +8edd80b3fb1 1215 Brorfelde 714 +0ab5ce808111 1268 Gorongosa 542 +63c55129 1260 Stonington-Island 579 +886090a35571 1428 Tubakuba 575 +7b2fddd6 1263 Holmegaard 630 +224ec122957 1164 Holmegaard 545 +9d478716 1282 Nordkapp 617 +1cb8cefaab4 1278 Gorongosa 606 +d2719728360 1145 Tambon-Pa-Fa 727 +c0f9ca8f476 1186 Zhangye-Shi 660 +83fea1e3 1365 Lemnos 596 +cf38d8107 1073 Nullarbor 613 +164cc47ace7c 1068 Zhangye-Shi 527 +d00ab6e33 1167 Sofia 574 +b50b0503 1169 Morgantown 514 +fed8853e496e 1098 Geoje-Si 688 +d21d32624 1288 Tambon-Pa-Fa 652 +92f4320298 1093 Morgantown 620 +89e60557edd 1345 Hajnowski 565 +829cc66f6524 1254 Luoyang 651 +b6ad98c5c8 1131 Geoje-Si 502 +a68d97fbfdb 987 Brorfelde 451 +a4fda9ce7e7 1132 Nullarbor 549 +13d8d416d 1328 Giessenmestia 590 +da517616ec 1272 Gorongosa 520 +cd1f4025 1419 Mamula 629 +88324193b87 1180 Sofia 597 +3de94090 1149 Tambon-Pa-Fa 590 +a8240f7292 1119 Brorfelde 675 +647315ef 824 Uzupis 668 +b9ac3a5e 961 Grimsey-Island 663 +be8b9d110 984 Tubakuba 485 +7c2e49058b 1022 Estacada 509 +f7566ec36 972 Uzupis 538 +b0ca7167f7 1265 Lemnos 679 +c5d2db28c 1206 Estacada 565 +e29a171ab 1278 Lemnos 602 +7f98bd73d5cc 1125 Nordkapp 628 +05c4bc08fd31 1210 Jayuya 516 +7cfb6f85 969 Grimsey-Island 589 +61e833fb 1158 Sukhumi 502 +0b3b738f0 1226 Stonington-Island 688 +e0862b3984ce 1270 Morgantown 565 +ced9502128 1077 Ijsseloog 576 +113bdf3f311 1167 Grimsey-Island 615 +22b8e494f 1029 Nullarbor 623 +52e1d5566142 1173 Ijsseloog 721 +d7d9600a9018 984 Aalborg 559 +bfd6cbaf09e1 898 Nullarbor 615 +e4964650f 1093 Karlukovo 675 +c4a45e60f 1078 Jayuya 573 +443a80bb 1286 Mamula 872 +d4bc8ebfb 1373 Mamula 651 +34f4312fdd0 1121 Grimsey-Island 644 +fc20a36d036 928 Almaty 738 +11ea654a37dc 1306 Tambon-Pa-Fa 653 +70e5c8cd42 1185 Mora 546 +382daab54 1461 Nullarbor 601 +6e6ee9c06 1053 Hajnowski 565 +0fe6b54be76 1318 Sukhumi 591 +b6ef99699d8 963 Uzupis 549 +0d3a5b9861 1232 Luoyang 547 +f87121d062 1127 Karlukovo 502 +cf8876d4e73 823 Stonington-Island 693 +1b38b7b4d94 1205 Aalborg 660 +ae037be7d2 1187 Gorongosa 548 +2f3d30dd1d9 1230 Lemnos 679 +24ebbe60 1331 Estacada 628 +234cd3dc12de 1206 Ijsseloog 468 +d053b7fa98 1125 Puente-Laguna-Garzonkuala-Penyu 621 +146c154627 1321 Parowan 658 +06b34cf1 1134 Nordkapp 529 +59ea16ce6364 1110 Grimsey-Island 711 +34f1e2873504 1042 Giessenmestia 572 +498d42d27 1095 Holmegaard 562 +355f35a449d 1061 Sofia 539 +68ac312e3af5 1421 Geoje-Si 621 +909acf5b3 1137 Almaty 599 +ddc31baf1 1175 Puente-Laguna-Garzonkuala-Penyu 612 +f22c113c 1217 Mamula 521 +476cd20cca 1046 Nullarbor 648 diff --git a/anton/SummerOfCode/01-holidays.txt b/anton/SummerOfCode/01-holidays.txt new file mode 100644 index 0000000..63fa029 --- /dev/null +++ b/anton/SummerOfCode/01-holidays.txt @@ -0,0 +1,124 @@ +07ea553e 1348 Zhangye-Shi 14 +02d4b258b8a 1152 Estacada 3 +d29a0551504e 1210 Zhangye-Shi 7 +3e4d219009 904 Geoje-Si 7 +97afbad2bb 1129 Stonington-Island 21 +98c040c3 1375 Nullarbor 14 +8d178e8fe50 1310 Aalborg 7 +b4c9727f3a 955 Nordkapp 7 +646c6f60 1247 Sofia 10 +698a05914c 1440 Giessenmestia 14 +6106854836f 748 Brorfelde 14 +44aadddc 1245 Tubakuba 14 +c81a1fcfb 931 Sukhumi 21 +dc8aebebfc2 946 Parowan 3 +0e9e7473eb 1023 Gorongosa 14 +c7b043d2 1327 Nullarbor 7 +7bd023c3 1191 Holmegaard 21 +072a1106d 1329 Lemnos 14 +0b9cb9e950 1458 Estacada 7 +54945eeed430 1001 Nullarbor 10 +ccf770ecaa2 1206 Tubakuba 14 +90b158ef 1350 Morgantown 14 +e1d4e033df7 1057 Grimsey-Island 21 +fad4adaf 1297 Luoyang 3 +1cf53c93a 919 Sofia 7 +ddd7891fb37 1348 Almaty 7 +d752d52589 1148 Geoje-Si 21 +062bb5cf 1178 Zhangye-Shi 14 +c19a8114d44 1188 Hajnowski 3 +44946ac3d470 852 Karlukovo 3 +989f0ca8 930 Nordkapp 21 +d826034e08 1195 Tubakuba 14 +f4dd99265 1294 Karlukovo 21 +6ea4cebc128f 775 Mora 10 +328fd2275 806 Aalborg 21 +fd7278523 1363 Sukhumi 7 +865d85be7 896 Ijsseloog 21 +b7f4d5b476c 1755 Nullarbor 14 +eca25db7a 968 Gorongosa 14 +19ef5c556 1624 Sofia 14 +d6b5aa1d219e 1303 Aalborg 14 +deb36f50 1761 Nordkapp 14 +744efb40a295 1068 Morgantown 14 +07cc90dd3 1209 Lemnos 14 +4c0c6a48 1069 Sofia 7 +7ed300f23 1474 Luoyang 21 +f7db1341c848 1240 Nullarbor 3 +48b4a7976bf1 1133 Jayuya 3 +dd23065a18 1391 Stonington-Island 14 +0c33d4e1 1551 Luoyang 7 +d33d871c 1150 Aalborg 14 +2da4222c8 1374 Geoje-Si 10 +e11b4c5c 1075 Parowan 3 +aef2526d1978 1422 Morgantown 21 +7b95b6d95 1525 Morgantown 21 +ffcc1079c877 1579 Puente-Laguna-Garzonkuala-Penyu 14 +ddb13dd26f 1158 Lemnos 10 +6a1a190ed083 1042 Sukhumi 14 +3ca80302270 1404 Luoyang 7 +5daea80f7d2 1399 Sofia 7 +91bc0a2d0 1180 Almaty 14 +53b5f150 1149 Jayuya 10 +0085ebcc2b2 1442 Holmegaard 21 +4a52d756 1174 Uzupis 7 +d57afd163 1140 Geoje-Si 7 +9910d5838754 860 Morgantown 14 +6454824e86 1359 Lemnos 7 +9aa4a9bbd9f8 1391 Aalborg 10 +980e8f3064fc 976 Giessenmestia 14 +1d6a1b08 927 Luoyang 21 +64f067b7fc 1392 Luoyang 14 +b268e12d1d0b 984 Mora 7 +eac0d3ed07 1531 Brorfelde 21 +beaf2d8e35 947 Grimsey-Island 3 +e2c945275868 867 Zhangye-Shi 21 +677046c1f45d 1213 Karlukovo 10 +d3e9b79053c 1274 Aalborg 21 +cb24efd90 948 Morgantown 21 +ca9fe765 1491 Grimsey-Island 14 +d5821111c6c 1236 Nordkapp 14 +dcdccf9a55b8 1574 Ijsseloog 7 +e689ad12 1405 Zhangye-Shi 21 +8b6e8446 1360 Morgantown 21 +fafb6875f 1140 Brorfelde 21 +182f52c61f 916 Estacada 10 +4a264d5f4e 1262 Ijsseloog 14 +bf086837530 1162 Parowan 14 +dbfe9d638ef 1221 Nordkapp 7 +9e1d45351 1292 Giessenmestia 21 +541bd6119 1028 Mamula 7 +0aeeffa1a3 1209 Luoyang 21 +901c5848 1107 Sofia 10 +3100ad053f 910 Tambon-Pa-Fa 10 +295b0f07 997 Zhangye-Shi 21 +7bb0a03d18ab 1673 Brorfelde 21 +25c7800fd18 1582 Lemnos 14 +18952053b 1049 Mamula 7 +bc53df7eb 1168 Hajnowski 14 +8cb1c9b33b 1001 Almaty 7 +911bee88b048 1218 Almaty 21 +8f6abf6d 1580 Sukhumi 14 +85f6122bb848 1296 Gorongosa 14 +094ee9edf9ce 676 Tubakuba 7 +17637f07 1242 Jayuya 7 +6e4ca2fdf 684 Ijsseloog 3 +5d85167ed5c 878 Luoyang 3 +91e78da67 1054 Nordkapp 7 +43cd83bb01 1443 Giessenmestia 14 +9c1f692ea 1061 Stonington-Island 21 +0e792455b8d 1007 Tambon-Pa-Fa 14 +669c3fe3f 1038 Karlukovo 7 +ca039bc4a1ed 1216 Sofia 7 +7a95be26f65 944 Jayuya 7 +3da51cf71e 1864 Giessenmestia 14 +811b8fcf 1335 Morgantown 10 +4cffd22dd9b9 1089 Stonington-Island 14 +894fa3b99c 704 Gorongosa 7 +b73e3ee1b21 1028 Zhangye-Shi 7 +83377c09f17 980 Sofia 7 +686e7e91a 1282 Giessenmestia 10 +c18ca0a78 1069 Grimsey-Island 14 +14e6e1034a 948 Nordkapp 21 +3634c172 1176 Grimsey-Island 10 +08d2936f40 1175 Estacada 3 diff --git a/anton/SummerOfCode/02-lifts.txt b/anton/SummerOfCode/02-lifts.txt new file mode 100644 index 0000000..f591c54 --- /dev/null +++ b/anton/SummerOfCode/02-lifts.txt @@ -0,0 +1 @@ +vvv^^v^v=vv^v^^vvvv^^v=^=^^=^^^=^^^v=^^^=^^v^^v^vv^^v^^^=v^v^^^v=^vvv^^^^v^^^^^v^v^v^^v=^^^^^v=v^^v=^v^^=v^^vvv=^^^vv=^^=^vv^v^^^vv^v^^vvv^v=^=^=^^v^v^^=vvvv^v^vv=^^^=^^^v^v^vv^^vv^vv^^=v=v=v^=^=^^=v^^^=v^=^vvv^^vv^^=^v^vvv=v^vv^v^^^=^v^v^vv^^^^v^vv^vv^^v=v^^v^^^^vv=vv^v=^^=vv=^v^v^^^^^vv^v=^=^^vvv^v^vvvvv^^vv^v^v^^v^=^v^^^^vvvv=^=vv^^^^^^^^v^vv^^^^v^^^v^^^v^^v^vv^^^^=vv=^v^^^vvvv^v^vvv^v^=^=v^^^^^=vvv^vvvvv^^vv^^vv^vvv^^^=v^=^=^v^^^=v=^^vvv^v^^^v=^^^=^^vv=v^^^^^^^vv^v^vv=v^^^vv=v^v^=^v^^=^^v^v^v^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^vv^^^^=^vv^v^^vv^^^^=v=^^=^^^^v^=^^vvv^^=vv=vv^^^^^v^v^^^vvv^vvv^v^^v^=vvvv^^=^^=^=^^^^^=^v^=^vv=v^v^vvvv=v^^vv^=vv^^vv^^^vv^^^v^v^^^^vv^vv^=^v^^vvvv^^^^^v^^v^^=^=^^^v^v^^^v=v^^=^^vv=^vvv=^=v^^vvv=^=^^v=v^=v^v=^=^^^^=v^^v^^v^^v=vv=^^^v=vvv^vv^^v=vvv=vv^v^v^vv^^^^^=vv=^v=vv^v=^v^^= \ No newline at end of file diff --git a/anton/SummerOfCode/build.xml b/anton/SummerOfCode/build.xml new file mode 100644 index 0000000..2798134 --- /dev/null +++ b/anton/SummerOfCode/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project SummerOfCode. + + + diff --git a/anton/SummerOfCode/manifest.mf b/anton/SummerOfCode/manifest.mf new file mode 100644 index 0000000..1574df4 --- /dev/null +++ b/anton/SummerOfCode/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/anton/SummerOfCode/nbproject/build-impl.xml b/anton/SummerOfCode/nbproject/build-impl.xml new file mode 100644 index 0000000..a7927ee --- /dev/null +++ b/anton/SummerOfCode/nbproject/build-impl.xml @@ -0,0 +1,1419 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/anton/SummerOfCode/nbproject/genfiles.properties b/anton/SummerOfCode/nbproject/genfiles.properties new file mode 100644 index 0000000..421e395 --- /dev/null +++ b/anton/SummerOfCode/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=79da8f9b +build.xml.script.CRC32=68ea11f2 +build.xml.stylesheet.CRC32=8064a381@1.79.1.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=79da8f9b +nbproject/build-impl.xml.script.CRC32=b273453e +nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48 diff --git a/anton/SummerOfCode/nbproject/private/private.properties b/anton/SummerOfCode/nbproject/private/private.properties new file mode 100644 index 0000000..8d245d5 --- /dev/null +++ b/anton/SummerOfCode/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\ad2472\\AppData\\Roaming\\NetBeans\\8.1\\build.properties diff --git a/anton/SummerOfCode/nbproject/project.properties b/anton/SummerOfCode/nbproject/project.properties new file mode 100644 index 0000000..eeffe9d --- /dev/null +++ b/anton/SummerOfCode/nbproject/project.properties @@ -0,0 +1,74 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/SummerOfCode.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=summerofcode.Day0 +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/anton/SummerOfCode/nbproject/project.xml b/anton/SummerOfCode/nbproject/project.xml new file mode 100644 index 0000000..fa3708e --- /dev/null +++ b/anton/SummerOfCode/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + SummerOfCode + + + + + + + + + diff --git a/anton/SummerOfCode/src/summerofcode/Day0.java b/anton/SummerOfCode/src/summerofcode/Day0.java new file mode 100644 index 0000000..2e1ee07 --- /dev/null +++ b/anton/SummerOfCode/src/summerofcode/Day0.java @@ -0,0 +1,44 @@ +package summerofcode; + +import java.io.FileReader; +import java.util.Scanner; + +/** + * + * @author Anton Dil + */ +public class Day0 +{ + public static void main(String[] args) throws Exception + { + Scanner sc = new Scanner(new FileReader("00-prices.txt")); + + String id, loc, bestId = ""; + int nullarbor = 0; + int price, extras, nextCost; + int bestCost = Integer.MAX_VALUE; + + while(sc.hasNext()) + { + id = sc.next(); + price = sc.nextInt(); + loc = sc.next(); + extras = sc.nextInt(); + + if(loc.contains("Nullarbor")) + nullarbor++; + + nextCost = price + extras - Math.min(extras, 500); + + if(nextCost < bestCost) + { + bestCost = nextCost; + bestId = id; + } + } + + System.out.println("Nullarbor holidays " + nullarbor); + System.out.println("Best price holiday " + bestCost + " id " + bestId ); + } + +} diff --git a/anton/SummerOfCode/src/summerofcode/Day1.java b/anton/SummerOfCode/src/summerofcode/Day1.java new file mode 100644 index 0000000..68bd847 --- /dev/null +++ b/anton/SummerOfCode/src/summerofcode/Day1.java @@ -0,0 +1,78 @@ +/* + * Day 1 parts 1 and 2 + */ +package summerofcode; + +import java.io.FileReader; +import java.util.HashMap; +import java.util.Map; +import java.util.Scanner; + +/** + * + * @author Anton Dil + */ +public class Day1 +{ + private final static Map scores = new HashMap<>(); + + static + { + scores.put("Almaty", 2.0); + scores.put("Brorfelde", 0.9); + scores.put("Estacada", 0.4); + scores.put("Jayuya", 0.6); + scores.put("Karlukovo", 2.2); + scores.put("Morgantown", 2.9); + scores.put("Nordkapp", 1.5); + scores.put("Nullarbor", 2.2); + scores.put("Puente-Laguna-Garzonkuala-Penyu", 0.4); + scores.put("Uzupis", 0.9); + } + + public static void main(String[] args) throws Exception + { + Scanner sc = new Scanner(new FileReader("01-holidays.txt")); + + String id, loc, bestId = ""; + double value, score; + double bestValue = 0; + int price, days; + int afford = 0; + + while(sc.hasNext()) + { + id = sc.next(); + price = sc.nextInt(); + loc = sc.next(); + days = sc.nextInt(); + + if(scores.get(loc) != null) + { + score = scores.get(loc); + } + else + { + score = 1.0; + } + + //only consider holidays we can afford + if(price <= 1200) + { + value = score * days/price; + + System.out.printf("%s %d %s %d value %.5f %n", id, price, loc, days, value); + afford++; + + if(value > bestValue) + { + bestValue = value; + bestId = id; + } + } + } + + System.out.println("Affordable " + afford); + System.out.printf("Best value is id %s with value %f%n", bestId, bestValue); + } +} diff --git a/anton/SummerOfCode/src/summerofcode/Day2.java b/anton/SummerOfCode/src/summerofcode/Day2.java new file mode 100644 index 0000000..3a9aa62 --- /dev/null +++ b/anton/SummerOfCode/src/summerofcode/Day2.java @@ -0,0 +1,46 @@ +package summerofcode; + +import java.io.FileReader; +import java.util.Scanner; + +/** + * + * @author Anton Dil + */ +public class Day2 +{ + public static void main(String[] args) throws Exception + { + Scanner sc = new Scanner(new FileReader("02-lifts.txt")); + int exit = Integer.MIN_VALUE; //replaceable floor value + String input = ""; + int floor = 0; + + while (sc.hasNext()) + { + input = sc.next(); //just one line of input in fact + } + + System.out.println("Input was " + input); + + for (char ch : input.toCharArray()) + { + switch (ch) + { + case 'v': + floor--; + break; + case '^': + floor++; + break; + case '=': + if (floor > exit) + { + exit = floor; + } + } + } + + System.out.printf("final floor %d, highest exit %d%n", floor, exit); + } +} diff --git a/anton/SummerOfCode/src/summerofcode/Day3.java b/anton/SummerOfCode/src/summerofcode/Day3.java new file mode 100644 index 0000000..b6f082a --- /dev/null +++ b/anton/SummerOfCode/src/summerofcode/Day3.java @@ -0,0 +1,104 @@ +package summerofcode; + +/** + * + * @author Anton Dil + */ +public class Day3 +{ + static final String pass = "the traveller in the grey riding-coat, who called himself mr. melville, was contemplating the malice of which the gods are capable."; + + public static void main(String[] args) + { + part1(); + System.out.println("\n PART 2 "); + part2(); + } + + static void part2() + { + int[] newcode = + { + ci('r'), ci('i') + }; + + final int alpha = 5, beta = 11; + + System.out.printf("newcode %d %d %n", newcode[0], newcode[1]); + + for (int i = 0; i < pass.length(); i++) + { + char nextCh = pass.charAt(i); + + if (nextCh >= 'a' && nextCh <= 'z') + { + newcode[0] = wrap2(newcode[0] + alpha * newcode[1]); + newcode[1] = wrap2(newcode[1] + beta * ci(nextCh)); + + System.out.printf("nextchar %c newcode %c %c %n", nextCh, ic(newcode[0]), ic(newcode[1])); + } //else skip this char + + } + } + + static void part1() + { + //assuming string length > 1 + int[] oldcode = + { + ci(pass.charAt(0)), ci(pass.charAt(1)) + }; + + System.out.printf("oldcode %d %d %n", oldcode[0], oldcode[1]); + + for (int i = 2; i < pass.length(); i++) + { + char nextCh = pass.charAt(i); + + if (nextCh >= 'a' && nextCh <= 'z') + { + //System.out.printf(" next char %c %d %n", nextCh, ci(nextCh)); + oldcode[0] = wrap(oldcode[0] + oldcode[1]); + oldcode[1] = wrap(oldcode[1] + ci(nextCh)); + + System.out.printf("next char %c oldcode %c %c %n", nextCh, ic(oldcode[0]), ic(oldcode[1])); + } //else skip this char + + } + } + + //char conversion to int scale, 1-based + static int ci(char c) + { + return c - 'a' + 1; + } + + //for readability, the int in char form + static char ic(int x) + { + return (char) (x + 'a' - 1); + } + + //oldwrap only needed adjustment by 26 + static int wrap(int x) + { + if (x > 26) + { + return x - 26; + } + + return x; + } + + //new wrap needs a modulus + static int wrap2(int x) + { + if (x > 26) + { + return (x - 1) % 26 + 1; + } + + return x; + } + +}