CT56334

Last signals of Sona

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The dispatch writer Sona has been asked to settle the inheritance fairly. On the desk lies a long table of signals readings. Task: Answer q queries 'l r' giving the XOR of a[l..r] (1-based, inclusive). Input format: First line: n and q. Second line: n integers. Next q lines: l r. Output format: Print one XOR per query. Constraints: 1 <= n,q <= 4000; 0 <= a[i] < 2^31; 1 <= l <= r <= n.

Example 1:

Input: 2432 404 1786523079 1430170321 1497511253 172118599 871666241 630680003 295413144 106187608 102999281 1443107614 246730424 513841708 415100995 1847641952 1011162540 526951216 982242693 390407857 469109257 1918215587 841687310 1485219417 1781518658 691343719 1588298805 1734881247 237546129 1716343669 927457144 1798123409 733791988 1898207886 1310260045 977674632 2015263533 297823426 555673376 517632490 2025386145 1707968671 1798525936 1703815548 1978600474 1981157769 1320950386 105718087 1843267687 759440368 1234965694 2138365351 1429283574 1917140465 1974921162 557356950 1857429550 2024049110 69536448 509727768 1310565652 1711646825 2134826058 1098265140 1058198142 468864259 1717514350 1646361978 1812016794 2063870880 818210800 917121297 1330966382 2102282221 331386 766890251 1903616554 39…
Output: 1429765215 1595031905 1135681233 359834868 1699408834 1544300285 770358833 567635288 884727034 1923738714 2071051835 1193497982 1192018520 444361165 476893797 1686457110 1123945005 1651857252 856928147 1473041742 668940332 917022522 26204089 2129338131 406164614 799144713 1559777166 2142143455 2131599186 620274191 1000719646 70848966 779914369 38343324 1926936602 1193327928 1889952338 447488116 396423951 1531670322 813474889 1360050341 1239350092 475319777 1302147235 2053108844 466267874 780830260 967705344 387986108 1967435256 2056209899 1972503874 331732505 2125058437 903348063 341802880 2054808095 70839443 1458712800 858790719 22809830 1973988672 452535525 1685534948 647913135 1276975543 1314689986 1462181627 2078285421 1446470819 893353428 641676155 994935646 1105868633 899871190 21336…

Example 2:

Input: 3861 71 1703048416 103817445 1195625412 2120327784 1253595654 508357780 609584236 847790813 1383530336 2113515091 1754209953 198606320 1678369500 1837653264 1996356256 2062093543 77671988 1635056433 1854199208 404536016 1874924061 2039617085 1247550890 1592386322 376150625 1802530707 947125319 820326495 785998178 740827157 832345492 1986326375 1542998580 484118662 375591268 1246789718 1845692381 656002368 1497020493 958828844 1087963987 1431588959 344203099 1469582902 574957738 78578674 1550062778 1470625419 1222628624 483208776 878095211 1908150470 237783177 1095911344 27667530 653029801 1128861315 816319722 446919734 1068334151 1805673904 728025767 193977112 220873556 717687905 848196963 11746765 1119037010 242884263 1298871887 113612870 1335733575 1775701517 1936165880 247158294 3489801…
Output: 1805120041 1510106635 1901182261 1426551887 1047679602 360305838 652300643 623322055 376931763 279637111 1475661010 160065172 280084551 660704163 252538064 2031373688 2013634132 49829230 2022893264 1783961723 1520024416 836466694 546516203 1061059401 1409380992 613494760 1546318195 655780677 1973769737 1344377092 1729812700 1079359588 553647378 1677175449 2077276899 478812234 766023521 1008226079 944870745 313843850 1199437005 505598588 401139499 490608846 1830794398 741817852 1348400423 1966893766 1492492371 123143012 1606216476 1020719489 713568316 1715542243 1590985053 680749315 8284172 1171753563 345085377 1531226287 1735451963 658975679 1755573348 836156903 1326165859 1000410233 1452519592 671774709 1661642888 891965202 1755126921

Example 3:

Input: 2654 692 559594251 925357649 1945139488 1146592575 1120929540 952285908 230146596 1585812997 1907451673 303676232 2015021862 338156922 71824591 1704168240 544465360 1633194549 1556876061 1850826960 1203750275 302324503 56094212 822622198 1834282243 1021242841 1579419501 355508392 935591186 1763415541 2103057341 488340788 2039813313 504140670 1496494977 141870847 1252188107 1817877174 129110703 298143534 1279895666 1224723664 1447278186 1807186898 161363311 1376274062 740222296 1591505496 870816674 477378326 951600462 858355305 2055714592 418455389 578729685 691446941 1264054023 464437152 1339930533 1754818196 1306476717 1877340285 1560203270 178543950 1310090440 1872328944 55138850 1348256057 1073955376 1071654448 1303627548 15771180 95568495 788023950 663085052 1152251071 1868435708 34376…
Output: 240899814 380441026 1899877125 942501881 33215807 1046195259 1647398105 1224141899 557356947 1661578357 1051724281 1062577710 2070480752 297685340 1653280199 223362721 828541671 612944009 411444313 1382306711 190506607 458333716 1928624712 1688726084 136219012 197757415 683330471 65799334 1627939897 473041441 1970337734 1542542014 161769489 1556418533 559210413 1736968628 1864335256 2004195330 687513601 825590185 516840831 1823706151 1595573528 1146224310 1053203568 1207020723 1019017798 1385558475 1733066756 401409906 435269345 876804438 918859776 356874710 851653067 1633126871 666276239 1683641660 2046522297 1932574166 1939162510 329545876 1231974836 1162302110 1544466076 877543821 1928677984 540863053 1121917095 739697513 1738288925 939279430 965015030 956279470 1512579217 1221745215 18…

Constraints:

1 <= n,q <= 4000; 0 <= a[i] < 2^31; 1 <= l <= r <= n.

Loading...
Test Cases:No test cases
No test cases available.
Last signals of Sona - MEDIUM Coding Problem | CodeTikki