1277 - How Many Days Are There

All about problems in Volume 12. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

1277 - How Many Days Are There

Post by brianfry713 » Tue Jul 15, 2014 9:37 pm

Input:

Code: Select all

0 1 119264 12 16 119428 4 2
0 31 797827 2 8 799546 11 4
4 27 -1480669 7 29 -1479901 4 10
6 5 562187 1 22 564395 4 2
5 23 1825395 5 28 1828741 6 8
6 21 924211 10 16 927488 12 22
1 3 -461521 9 5 -458576 6 17
5 4 -542289 9 24 -541795 9 10
0 2 1607804 3 26 1608654 4 3
4 9 -1110256 8 24 -1107573 12 6
4 12 -1847798 1 15 -1844035 12 22
5 12 1997115 11 6 1998243 6 21
1 31 1799595 1 28 1802451 3 14
4 10 771740 3 17 772145 4 9
3 24 -1839990 10 5 -1839357 7 20
1 30 -1220306 10 10 -1217768 6 10
6 6 1642656 7 15 1643670 7 1
5 16 1894957 1 17 1897098 10 29
6 4 -327664 3 6 -324511 7 19
1 1 1896741 9 27 1900263 4 27
0 23 321896 11 4 323313 9 16
6 5 27570 6 26 31458 4 28
6 27 -1092001 7 29 -1089575 7 28
4 7 480875 2 21 481238 11 2
0 18 -1873364 6 23 -1871923 3 22
3 20 -60914 4 1 -57320 11 10
4 10 1023622 6 3 1025626 12 26
4 25 -615962 3 27 -614600 4 30
2 9 -1500727 11 27 -1500204 11 16
4 19 118873 6 4 122478 1 14
0 31 -723512 5 30 -720358 5 3
1 31 -352466 2 6 -348947 5 23
4 31 -1722771 6 25 -1721115 7 6
0 21 1547537 10 8 1550793 4 24
3 3 -91998 9 9 -88914 9 26
3 24 516133 9 15 516481 10 13
1 18 -83801 11 7 -80277 2 27
1 15 616064 6 21 618582 4 26
5 4 1620455 5 23 1622783 4 8
4 15 -1187850 10 19 -1187772 3 20
6 1 452186 5 7 452398 3 1
0 17 -775165 3 22 -772601 4 19
4 7 1916742 12 22 1916744 1 28
2 20 1342061 10 31 1343346 5 24
6 11 677989 1 22 679159 10 15
2 19 58870 12 22 61414 5 28
4 15 1248058 10 10 1250507 5 20
4 31 1767380 8 13 1770294 8 24
3 14 145665 10 4 145741 9 19
5 25 -839835 5 4 -836038 10 21
0 21 -1257670 3 16 -1256533 5 30
1 15 1125251 11 13 1125384 11 28
0 5 376991 10 31 380929 2 20
5 7 -1019656 2 26 -1017416 5 7
5 11 -285690 4 18 -283901 3 28
6 19 206673 6 12 208408 4 14
5 21 182495 8 24 183155 7 19
2 19 1358125 3 27 1360900 6 23
4 23 -800580 10 15 -799078 8 20
6 15 1461351 11 20 1464302 12 5
4 4 -1187947 12 24 -1186019 7 19
4 3 65125 9 21 68379 6 13
0 10 -1527827 12 20 -1525708 5 16
5 29 -445933 4 19 -445317 9 4
2 4 904859 1 8 905748 3 26
6 16 -969186 4 7 -968493 11 14
4 22 33231 10 6 36840 1 2
2 2 -931437 6 23 -928523 9 14
1 20 1362988 5 17 1365790 2 11
3 15 1036722 12 28 1039412 8 17
2 27 -635802 11 29 -634958 6 24
5 27 407531 1 1 409441 12 9
4 4 1624212 7 15 1624708 5 10
6 4 172803 1 6 173112 9 18
0 16 -1972094 3 30 -1969893 12 13
2 20 1318679 5 18 1319181 8 6
6 9 -527541 3 6 -523890 6 29
4 8 356375 3 24 357115 6 23
2 19 -667766 11 8 -665672 1 10
1 26 249321 6 19 252947 6 29
4 26 1205607 11 18 1209164 1 20
0 21 -1740191 11 6 -1738192 10 3
1 16 -1905092 2 13 -1903047 2 9
1 31 -705709 4 27 -703396 12 5
0 23 1410762 8 23 1414743 2 12
4 30 60955 7 16 64030 12 21
4 26 1858944 4 30 1862711 1 23
3 3 -809360 10 13 -805434 9 2
2 17 -819305 1 24 -816405 1 19
0 21 -1532650 1 11 -1528670 7 16
6 12 75174 1 18 79121 1 21
1 14 1778212 9 26 1778615 4 21
3 20 881046 9 21 882294 1 17
4 2 745588 5 15 747617 7 19
1 26 417801 4 16 418691 2 21
1 1 -40814 1 24 -40356 2 27
2 16 -1534052 5 22 -1533381 5 19
0 18 1446771 11 8 1447314 8 18
1 31 1686552 9 19 1687118 10 26
5 26 383413 11 1 386638 10 15
0 0
AC output:

Code: Select all

282
1720
1314
3793
5729
5636
5036
848
1455
4595
6474
1928
2849
694
1081
4004
1734
3667
5400
6022
2423
6679
4147
624
2467
6174
3442
2327
895
6200
3153
3511
1664
5568
5273
595
6052
4307
4000
133
361
4404
2
2200
2006
4369
4194
2931
131
6521
1945
230
6743
3833
3071
2978
1128
4766
2573
5048
3296
5588
3638
991
1520
1192
6181
4983
4798
4605
1442
3288
847
530
3766
861
6269
1268
3596
6210
6118
3419
3517
2308
6807
4821
6478
6713
4988
6807
6778
692
2142
3476
1524
784
1147
931
562
5514
My solution is based on the fact that there is a day of the week cycle every 400 years. I brute force up to three sections if needed. The part until the year % 400 == 0, a full 400 year cycle multiplied as needed, and the final section.
Check input and AC output for thousands of problems on uDebug!

baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Re: 1277 - How Many Days Are There

Post by baodog » Wed Jul 16, 2014 4:38 am

Some harder I/O to help you:
0 28 1999 11 18 1999 11 28
5 28 1999 11 18 1999 11 28
5 13 1999 1 1 1999 12 31
0 30 1976 6 30 1999 11 28
1 1 1 1 1 1 3 1
4 1 1 1 1 1 3 1
0 1 2001 3 1 2001 12 31
5 23 2005 9 23 2005 9 25
6 24 2005 9 24 2005 9 24
0 25 2005 9 23 2005 9 25
3 7 2005 9 10 2005 10 5
0 9 2005 9 10 2005 10 5
3 2 2005 11 3 2005 11 5
0 6 2005 11 3 2005 11 5
1 14 2005 2 1 2005 3 13
0 29 1900 1 30 1900 3 20
1 29 1900 1 30 1900 3 20
2 29 1900 1 30 1900 3 20
3 29 1900 1 30 1900 3 20
4 29 1900 1 30 1900 3 20
5 29 1900 1 30 1900 3 20
6 29 1900 1 30 1900 3 20
0 29 2000 1 30 2000 3 20
1 29 2000 1 30 2000 3 20
2 29 2000 1 30 2000 3 20
3 29 2000 1 30 2000 3 20
4 29 2000 1 30 2000 3 20
5 29 2000 1 30 2000 3 20
6 29 2000 1 30 2000 3 20
0 29 2007 1 30 2007 3 20
1 29 2007 1 30 2007 3 20
2 29 2007 1 30 2007 3 20
3 29 2007 1 30 2007 3 20
4 29 2007 1 30 2007 3 20
5 29 2007 1 30 2007 3 20
6 29 2007 1 30 2007 3 20
3 1 2004 9 1 2005 6 1
6 1 2003 2 1 2005 1 1
3 14 2004 1 15 2005 9 17
6 25 1999 12 15 2003 1 30
5 1 2000 12 1 2100 1 1
0 12 -1999999 1 1 -1999600 12 31
1 13 -1999999 1 1 -1999600 12 31
2 14 -1999999 1 1 -1999600 12 31
3 15 -1999999 1 1 -1999600 12 31
3 29 -1999999 1 1 -1999600 12 31
4 30 -1999999 1 1 -1999600 12 31
5 31 -1999999 1 1 -1999600 12 31
0 1 -1999999 1 1 2000000 12 31
1 1 -1999999 1 1 2000000 12 31
2 1 -1999999 1 1 2000000 12 31
3 1 -1999999 1 1 2000000 12 31
4 1 -1999999 1 1 2000000 12 31
5 1 -1999999 1 1 2000000 12 31
6 1 -1999999 1 1 2000000 12 31
0 31 -1999999 1 1 2000000 12 31
1 31 -1999999 1 1 2000000 12 31
2 31 -1999999 1 1 2000000 12 31
3 31 -1999999 1 1 2000000 12 31
4 31 -1999999 1 1 2000000 12 31
5 31 -1999999 1 1 2000000 12 31
6 31 -1999999 1 1 2000000 12 31
0 30 -1999999 1 1 2000000 12 31
1 30 -1999999 1 1 2000000 12 31
2 30 -1999999 1 1 2000000 12 31
3 30 -1999999 1 1 2000000 12 31
4 30 -1999999 1 1 2000000 12 31
5 30 -1999999 1 1 2000000 12 31
6 30 -1999999 1 1 2000000 12 31
0 1 -1999999 1 1 2000000 12 31
1 2 -1999999 1 1 2000000 12 31
2 3 -1999999 1 1 2000000 12 31
3 4 -1999999 1 1 2000000 12 31
4 5 -1999999 1 1 2000000 12 31
5 6 -1999999 1 1 2000000 12 31
6 7 -1999999 1 1 2000000 12 31
0 8 -1999999 1 1 2000000 12 31
1 9 -1999999 1 1 2000000 12 31
2 10 -1999999 1 1 2000000 12 31
3 11 -1999999 1 1 2000000 12 31
4 12 -1999999 1 1 2000000 12 31
5 13 -1999999 1 1 2000000 12 31
6 14 -1999999 1 1 2000000 12 31
0 15 -1999999 1 1 2000000 12 31
1 16 -1999999 1 1 2000000 12 31
2 17 -1999999 1 1 2000000 12 31
3 18 -1999999 1 1 2000000 12 31
4 19 -1999999 1 1 2000000 12 31
5 20 -1999999 1 1 2000000 12 31
6 21 -1999999 1 1 2000000 12 31
0 22 -1999999 1 1 2000000 12 31
1 23 -1999999 1 1 2000000 12 31
2 24 -1999999 1 1 2000000 12 31
3 25 -1999999 1 1 2000000 12 31
4 26 -1999999 1 1 2000000 12 31
5 27 -1999999 1 1 2000000 12 31
6 28 -1999999 1 1 2000000 12 31
0 29 -1999999 1 1 2000000 12 31
1 30 -1999999 1 1 2000000 12 31
2 31 -1999999 1 1 2000000 12 31
6 27 125345 2 26 126490 3 30
1 9 -1122242 10 23 -1121739 7 15
2 25 -452942 1 17 -452757 2 17
6 7 825029 5 19 826049 11 7
6 26 250164 10 23 250313 3 23
6 9 -52432 10 5 -49090 7 20
5 9 858077 9 23 859826 10 18
5 31 -661676 9 4 -658689 2 3
4 7 714529 6 19 716244 6 20
0 14 52421 3 6 55443 1 11
2 16 564533 10 29 564893 11 20
0 29 1933017 4 25 1935895 6 12
4 2 208782 10 26 212407 9 18
5 14 575653 9 13 578066 4 22
2 21 -1321503 7 5 -1318012 12 25
6 18 1954045 2 21 1955871 10 2
5 25 -943964 11 22 -943330 7 9
6 28 -1205257 4 12 -1205074 4 29
4 8 -1472117 9 13 -1471320 4 26
0 12 543720 8 7 546360 3 17
0 7 -146165 12 10 -145711 11 25
3 7 -1817244 5 13 -1816663 5 22
0 8 1355353 1 23 1356948 4 18
5 21 175810 12 9 177823 9 14
1 18 384875 5 3 386923 11 15
2 13 1333397 11 21 1336393 5 17
4 28 -1333516 12 13 -1332986 3 8
0 30 999090 4 9 1000887 10 5
5 9 1822571 3 7 1826096 11 7
1 24 1437359 2 23 1439936 8 17
2 3 1614596 6 18 1614678 4 19
2 6 -1937311 4 1 -1933969 11 15
0 13 878644 9 16 881205 10 2
0 30 -1748515 11 8 -1745139 1 23
6 19 527281 9 1 527427 5 8
1 13 -649096 3 8 -647860 2 18
1 23 -427410 11 3 -423912 3 9
4 4 815430 8 21 817584 3 17
1 2 -1824734 7 6 -1823526 6 1
4 14 -1300195 12 15 -1299353 10 2
4 21 1845057 1 26 1847836 12 22
2 4 -175343 3 15 -172797 3 4
3 21 1052161 3 2 1053299 1 16
5 22 -345864 2 10 -345517 8 7
1 9 -1174187 8 26 -1172377 12 6
1 10 1391207 12 8 1394025 11 26
6 13 -1982092 5 16 -1980169 7 29
2 27 -55629 2 19 -53583 1 6
3 16 -152494 3 18 -149624 11 29
6 3 1624304 5 22 1627705 5 15
5 22 -1999709 10 13 -1996427 1 14
3 30 -1244552 10 22 -1243487 1 18
0 29 -1093952 6 3 -1091719 1 8
6 26 1926858 7 4 1928335 2 28
5 20 581485 1 8 583443 1 14
5 28 -905086 12 20 -903347 3 21
4 17 590949 7 27 592067 10 24
3 27 1760759 1 14 1763570 6 1
0 23 1997855 5 7 1998226 7 23
0 27 792388 11 23 796157 10 10
5 22 -353579 7 31 -352650 8 10
6 27 -1471039 7 31 -1469172 7 31
6 23 -185473 6 4 -182628 2 23
3 5 -1048312 4 2 -1047552 3 12
2 28 1638872 2 21 1641080 2 12
0 4 -1199120 5 2 -1197447 5 26
1 25 -904361 11 27 -903329 5 27
4 22 1358740 3 3 1360962 5 20
4 12 1159862 4 23 1160098 9 6
3 12 -346420 6 25 -343300 12 30
0 23 31725 6 12 35427 10 11
4 5 -38350 4 26 -37083 5 29
2 20 1817143 4 16 1820609 7 18
1 9 1271070 12 16 1274741 12 21
3 1 1426955 10 9 1428215 3 26
3 22 231209 7 20 232614 1 24
4 31 -172637 12 5 -170685 1 25
2 13 -245460 5 31 -242309 10 24
5 31 170104 2 10 171465 2 2
1 6 -1642816 8 13 -1638925 3 18
1 8 432450 2 25 435703 11 22
4 5 1692607 10 24 1693991 10 25
0 10 1598076 4 12 1600636 5 31
3 1 1357761 7 26 1360311 10 4
5 17 1081181 8 7 1082437 10 19
2 13 -599648 4 1 -598173 6 9
3 25 39391 10 30 42423 10 16
0 11 828531 4 20 829143 6 11
4 13 -761798 12 29 -758792 6 24
4 14 -1441387 1 26 -1437926 10 22
5 27 53993 9 20 57691 3 13
2 22 833566 6 22 836566 5 18
0 22 -205277 3 23 -204819 6 10
3 19 -1412505 6 12 -1411804 6 25
4 20 -81566 5 10 -81320 12 19
4 21 -760182 7 22 -757553 3 23
6 17 -500898 1 25 -498461 4 4
0 21 -383649 11 30 -382454 8 8
3 29 1676562 2 10 1677018 4 3
0 30 -610177 1 8 -607608 3 12
5 4 -1323308 11 10 -1323092 2 18
4 23 -208851 12 15 -207352 4 27
2 7 -15176 3 23 -14940 5 6
5 30 514487 10 2 516120 11 16
2 28 491521 10 21 494201 1 28
0 11 -99714 9 7 -95753 10 15
3 26 231084 8 3 234448 6 17
0 4 -262627 1 5 -260214 2 22
6 18 210551 6 3 211478 8 16
3 26 -417806 11 17 -416758 2 1
2 27 1357918 11 21 1359628 12 6
6 11 768282 3 6 771184 3 10
6 10 -370402 9 21 -366748 6 7
6 4 -400654 9 29 -398002 4 29
3 27 -1412555 7 30 -1410453 4 26
1 5 -1132393 7 25 -1130012 5 11
3 30 -1750306 7 29 -1746989 6 23
3 22 -1783963 8 13 -1783435 9 3
4 28 682777 1 19 686578 1 22
5 14 -30214 6 7 -27051 6 23
6 16 -476128 1 12 -473041 7 15
0 19 -986060 4 17 -983164 10 27
4 12 -288142 4 19 -284397 7 4
6 24 -323154 7 1 -322738 4 25
1 16 -1965237 7 30 -1963393 2 2
2 10 1993029 12 5 1995744 8 20
6 14 -1744983 1 16 -1741495 7 4
0 26 -786280 3 17 -784641 3 18
5 15 -390072 12 25 -386308 2 11
4 27 997506 8 7 1000078 6 27
2 2 -1479003 3 29 -1475724 5 27
4 10 -680414 9 30 -678731 4 1
4 23 433406 4 1 434671 11 13
3 9 427091 6 23 427270 3 13
4 1 135630 7 2 136745 5 11
2 25 526131 10 22 528840 7 27
5 10 -905003 5 29 -902456 3 30
0 2 338718 3 30 339363 6 7
2 1 -1455347 9 8 -1453143 10 27
6 23 -1791693 5 25 -1789278 5 2
6 23 537653 4 11 540617 5 11
4 22 1866317 9 12 1867298 6 6
5 31 -878135 12 29 -874902 9 3
3 18 -174198 7 6 -172448 2 9
0 8 -1959289 3 13 -1958214 8 25
5 6 -132536 4 5 -131498 3 24
6 22 87659 12 15 89226 10 4
2 24 -1703263 4 14 -1700204 9 30
3 31 -1931470 2 26 -1928236 6 10
0 12 1051637 7 20 1054320 5 19
5 22 -755123 3 25 -753938 6 30
5 19 1727610 3 16 1728329 1 11
3 10 1337325 10 25 1339472 1 9
3 22 -917838 7 1 -916373 11 2
2 17 -348162 5 5 -346502 10 3
4 14 1965861 10 16 1966280 7 29
6 25 -1072863 9 13 -1069087 5 4
1 29 -479982 2 27 -477398 12 7
5 12 -1403207 7 6 -1402493 9 3
2 25 -445445 6 5 -444404 2 17
5 7 1940964 8 9 1941957 7 22
6 17 -1469151 9 15 -1468120 4 1
3 16 1790853 11 17 1794390 8 1
4 3 550405 1 12 553851 10 27
0 27 -1865540 2 20 -1861805 5 12
5 22 1582696 5 24 1585368 6 13
5 28 -43157 7 16 -41615 5 15
0 2 1351370 3 7 1353071 3 21
4 9 670386 2 11 673329 11 9
4 17 -240658 5 16 -237246 4 4
2 22 -1832974 1 31 -1829799 8 14
3 18 -1734957 2 2 -1732520 5 1
2 2 -177843 6 21 -177801 9 9
2 20 -1098948 5 26 -1096629 10 26
2 17 -837981 12 22 -835527 1 24
2 26 1994536 3 1 1998326 4 3
2 10 648213 6 7 649670 5 9
0 6 -1693479 5 22 -1692561 12 14
1 25 905605 1 24 907209 11 7
3 9 -1474480 11 30 -1474056 7 30
6 5 1298196 4 15 1300674 3 30
0 19 -683826 9 2 -681500 10 6
3 30 -1042783 2 21 -1041509 4 24
1 1 1243988 5 5 1244843 5 10
0 28 -644656 9 21 -644504 12 21
5 22 -1706845 9 11 -1705921 5 11
2 26 1080319 8 28 1083690 10 9
4 21 -283205 5 2 -281061 7 29
3 3 1581777 10 21 1582426 9 17
1 26 649183 6 24 653081 6 20
4 22 -168026 8 24 -166196 2 12
1 23 1702926 3 3 1704519 10 13
5 20 -809440 10 27 -807296 3 7
0 1 -1830006 6 10 -1828183 1 25
3 15 -1775201 9 15 -1772070 12 1
5 10 -237868 11 1 -237492 1 24
4 13 899268 5 13 900214 6 20
0 6 -1712467 7 2 -1710043 10 17
3 24 -1531791 3 7 -1530895 8 25
3 26 -1807594 6 22 -1804158 7 19
0 0
1
0
1
35
1
2
2
1
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
3
5
3
6
170
685
685
685
685
642
627
399
6880000
6840000
6870000
6850000
6850000
6870000
6840000
4000000
3990000
4010000
3980000
4020000
3990000
4010000
6270000
6310000
6260000
6310000
6270000
6290000
6290000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6880000
6440000
6310000
4010000
1960
865
317
1755
253
5737
2995
2979
2947
5167
616
4633
6209
4126
5978
3128
1090
313
1364
4519
777
995
2744
3443
3517
5129
909
2816
6037
4406
140
5722
4398
5289
250
2116
6016
3682
2079
1445
4775
4354
1947
598
3112
4819
3290
3505
4929
5826
5638
1680
3593
2538
3369
2974
1919
4830
636
6473
1595
3193
4886
1299
3781
2866
1771
3807
406
5335
6332
2180
5938
6314
2157
2405
1962
5397
1357
6662
5564
2380
4396
4367
2151
2527
5216
1046
5141
5945
6357
5153
789
1199
421
4516
4173
2044
732
4027
369
2567
403
2570
4587
6782
5751
4133
1588
1790
2928
4970
6258
4542
3611
4076
5234
903
6528
5408
5302
4960
6442
711
3171
4669
5999
2807
6463
4399
5609
2889
2168
306
1910
4631
4363
1104
3784
4146
5090
1681
3225
3009
1847
1784
2678
5261
3218
4593
2034
1228
3668
2511
2855
719
6467
4142
1221
1778
1699
1764
6075
5922
6417
4588
2636
2908
5041
5859
5453
4191
72
3973
4219
6511
2504
1578
2756
728
4254
3983
2007
1462
260
1586
5788
3681
1110
6675
3134
2741
3689
3135
5362
642
1617
4164
1533
5874

Post Reply

Return to “Volume 12 (1200-1299)”