|
|
you put the first parenthesis (in the wrong place try to remove all the crutches that you wrote in your code, which are very convenient, but at the same time only slow down your code do not be smart in the code, do not add many characters at once, try to think step by step Example: 31 9973 31 Why python is VERY slow in mod? Got tle here That is test 2 Edited by author 14.11.2018 06:18 Unfortunately, std::string in C++ class is very slow... Class string (VS c++) is good for this problem. But if you write like "res+=char+res" You will get TL. Right: "res+=char", "reverse(res.begin(), res.end())" for input "10000 9999 10" my prog gives "1.(0001)". But I have WA#1. help me! Edited by author 25.12.2006 11:40 And what about 1000 9999 10 ? Good luck! Correct answer is 0.1(0001),isn't it? Thank you. but I have WA#1. Please give me some test or hint Edited by author 25.12.2006 22:02 Input 9800 9999 10 0 0 output 0.98(0098) or 0.9(8009) input 4 4095 4 1 9999 10 10 9999 10 100 9999 10 1000 9999 10 10000 9999 10 9800 9999 10 3 2 8 0 0 output 0.00001(000001) 0.(0001) 0.001(0001) 0.01(0001) 0.1(0001) 1.(0001) 0.9(8009) 1.4 this output is correct,isn't it? Correct output 0.(000010) 0.(0001) 0.(0010) 0.(0100) 0.(1000) 1.(0001) 0.(9800) 1.4 I have checked all the anwers in this post all are working fine and sample input is working fine still I got WA1?? Any idea for test1... please provide some rigourous test Thank you!AC now! Edited by author 12.01.2015 23:19 Correct answer for "1000 9999 10" is 0.(1000), not 0.1(0001). In another example 0.(9800) is correct, not 0.98(0098). Edited by author 25.12.2006 23:41 why? 'The output must not contain insignificant zeros.' 0.(1000) contain 3 zeroes on the end, don't it? sorry bad English. Edited by author 25.12.2006 23:42 For the case, 2794 6083 23 2794/6083, I get 0.4593128390596745027124 (in decimal) But when I convert 0.ACM from base 23, I get 0.459275088353744 (in decimal) Where is the mistake ? 2794 6083 23 reason:The correct result:0.ACMACMACMACM...........ACM....... (loop) What would be the answer for followin test case?? 1 9991 10 1 9992 10 1 9931 10 1 9997 10 1 958 10 0 0 Try this tests WITH other tests from forum: intput 1 12 10 13 15 10 57 180 10 0 0 output 0.08(3) 0.8(6) 0.31(6) large tests: 1 9991 10 1 9992 10 1 9997 10 1 958 10 0 0 0.(000100090081072965669102191972775497948153338004203783405064558102292062856570913822440196176558903012711440296266639975978380542488239415473926533880492443198878991091982784506055449904914422980682614352917625863276949254328896006405765188669802822540286257631868681813632269042137924131718546692022820538484636172555299769792813532178961064958462616354719247322590331298168351516364728255429886898208387548793914523070763687318586728055249724752277049344409968972074867380642578320488439595636072465218696827144429986988289460514463016715043539185266740066059453508157341607446702031828645781203082774497047342608347512761485336803122810529476528875988389550595535982384145731158042238014212791512361125012511260134120708637773996596937243519167250525472925633069762786507857071364227805024522069862876588930037033329996997297567811029926934240816735061555399859873886497848063256931238114302872585326794114703232909618656791112000800720648583725352817535782203983585226704033630267240516464818336502852567310579521569412471224101691522370133119807827044339905915323791412271043939545591031928735862276048443599239315383845460914823341006906215594034631168051246121509358422580322290061054949454509058152337103393053748373536182564307877089380442398158342508257431688519667700930837753978580722650385346812130917826043439095185667100390351316184566109498548693824441997798018216394755279751776598939045140626563907516765088579721749574617155439895906315684115704133720348313482133920528475628065258732859573616254629166249624662195976378740866780102091882694424982484235812231007907116404764287859073165849264337904113702332098889) 0.000(1000800640512409927942353883106485188150520416333066453162530024019215372297838270616493194555644515612489991993594875900720576461168935148118494795836669335468374699759807846277021617293835068054443554843875) 0.(000100030009002700810243072921876562968890667200160048014404321296388916675002500750225067520256076823046914074222266680004001200360108032409722916875062518755626688006401920576172851855556667) 0.0(01043841336116910229645093945720250521920668058455114822546972860125260960334029227557411273486430062630480167014613778705636743215031315240083507306889352818371607515657620041753653444676409185803757828810020876826722338204592901878914405) What is the maximum number of divisions needed to get the full period? I got TLE this O(n^2) algo there n is the number of divisions. O(n*lg n) from number of divisions also TLE. But why...? O(n) AC in 0.234 O(n^2) memorization of prev remainders in vector with linear search O(n*lg n) memorization of prev remainders in set O(n) just used bitset<10000> cause all remainders is less then 10000 But why O(n*lg n) TLE!?!?!? try: 10000 9999 10 My answer is 1.000(1000) Is it correct? My AC program gives 1.(0001) My program gives 1.(0001) too. But I got WA#1. |
|
|