Notes
This function is in beta test. Please help improve it in the issues
here.
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Memory Exceeded. And the exit code of your program is -9, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
JOJ Answer
957 1020889211 242 284 454 846 1248755835 1415692053 1084514833 1231085121 1216580797 1298631308 1008379669 1048650184 1228948560 331 1236453014 1005837316 1052647060 1379795475 1452551895 1225508535 1187534554 1365665510 1015344366 1061033038 1084414876 1469600493 449 1086630001 271 1174683841 1190532440 1104637927 1123172433 1156732669 1466049030 1445206152 1422488492 1454842366 773 337 1252727176 1338182985 1206029739 1109102403 1417580331 1421544243 327 1173937999 522 1291204572 134 1148399484 947 229 1088871665 949 1182887594 784 1434311513 1100538348 1006473713 1063691694 454 1075178202 999 863 577 1098644593 1381552968 45 1001037729 1333934154 1426834847 28 1013871336 1191191751 1420331921 1269112273 1211627857 903 1198029154 1122188329 1334902750 370 1125980500 1046995927 1243315249 1167888555 44 762 1316762372 1195169457 315 1247309141 972 1461183548 1222327583 1251339233 145 515 1459937477 1487814182 1074681066 1227451495 1234595217 168 1214316116 1433457252 1240198285 106 884 1435978790 623 61 1394