Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | Страница 2 | TLE 4 | 👑TIMOFEY👑 | 1189. Pairs of Integers | 16 авг 2023 21:26 | 1 | TLE 4 👑TIMOFEY👑 16 авг 2023 21:26 Try to think in terms of mathematics, trying to make accurate judgments | attention! you must sort answer! | Felix_Mate | 1189. Pairs of Integers | 5 авг 2017 20:58 | 1 | I got WA4. Then i sorted answer by <length, int, int> and got AC. | what's the test case 7???? All the cases given hv been passed alr... | flyingpig | 1189. Pairs of Integers | 9 мар 2022 14:45 | 2 | what's the test case 7???? All the cases given hv been passed alr... | Only some hours to solve it ! I think it's simple problem. Although at the first sight, it's likely hard. | Phan Hoài Nam (Harvey Nash) | 1189. Pairs of Integers | 12 янв 2011 15:27 | 1 | You can go from last digit to the first (the leftmost digit to the rightmost digit). For example : 302 Considering 2 : There are some possibilities: 0 + 2, 1 + 1, 2 + 0, 6 + 6, 5 + 7 ... (first operant is of the larger number, second operant is of the smaller number). Considering 0 : For each possibilities, you try to find out some possibilities that can be combined to produce 0 : 0 + 0... You can try any combinations to produce 0 if two operants used to produce 2 is equal, if they are different, you only have an only way, it reduce very much calculations). Considering 3 : The last digit, you can stop here and consider whether you have achieved a solution. | 250+52 | Edric Mao | 1189. Pairs of Integers | 31 окт 2010 02:45 | 2 | 250+52 Edric Mao 30 окт 2010 20:05 why this don't suitable for the sample? It is not allowed to reorder digits | WA 4 | Глащенко Никита | 1189. Pairs of Integers | 16 окт 2012 18:51 | 3 | WA 4 Глащенко Никита 7 авг 2009 13:26 Can anybody help me with WA 4? My program passes all tests given in discuss... Re: WA 4 Глащенко Никита 7 авг 2009 19:35 Silly mistake, as usually. Incorrect number of zeros. Re: WA 4 IgorKoval(from Pskov) 16 окт 2012 18:51 Try this test: 100 Answer: 3 91 + 9 = 100 95 + 5 = 100 100 + 00 = 100 Somebody can get "50 + 50 = 100". It's wrong by problem. =). Edited by author 16.10.2012 18:52 | Solution best ? | trunghieuhf | 1189. Pairs of Integers | 11 ноя 2011 20:12 | 2 | | Could anybody give out a test that let this program go wrong? | Nickolas Kakà | 1189. Pairs of Integers | 28 июн 2008 20:14 | 1 | Could anybody give out a test that let this program go wrong? Code: type ac=^acm; acm=record v1:longint; v2:longint; left,right:ac; end; var a,c:ac; b,d,e,f,g,h,i,j,k,l,m,n,s,p,r:longint; function mln(a:longint):extended; begin if a=0 then exit(a) else exit(ln(a)); end; procedure goal3(m,l,n:longint); var i,j,b,p:longint; procedure goal1(var a:ac); begin if a=nil then begin new(a); a^.left:=nil; a^.right:=nil; a^.v1:=b; a^.v2:=p; inc(s); end else if b=a^.v1 then else if b<a^.v1 then goal1(a^.left) else goal1(a^.right); end; begin j:=m div 11; i:=m-j; if i div 10=j then begin b:=i*l+n div 2; p:=j*l+n div 2; if trunc(mln(b)/mln(10))+1>trunc(mln(p)/mln(10))+1 then goal1(a); end; if (m div 10>0)and not odd(m mod 10) then goal3(m div 10,l*10,(m mod 10)*l+n); if (m div 10>1)and not odd(m mod 10) then goal3(m div 10-1,l*10,(m mod 10+10)*l+n); end; procedure goal2(a:ac); var i:longint; begin if a^.left<>nil then goal2(a^.left); if a<>nil then begin write(a^.v1,' + '); for i:=trunc(mln(a^.v2)/mln(10))+2 to trunc(mln(a^.v1)/mln(10)) do write('0'); writeln(a^.v2,' = ',k); end; if a^.right<>nil then goal2(a^.right); end; begin read(m); k:=m; s:=0; a:=nil; goal3(m,1,0); writeln(s); goal2(a); end. | Help! Eager! | Nickolas Kakà | 1189. Pairs of Integers | 26 июн 2008 20:01 | 3 | 'Crash (access violation)| 17| 0.015 |182 KB ',WHAT IS IT? I just can't understand! Read FAQ Vladimir Yakovlev (USU) 25 июн 2008 14:08 Could anybody give out a test that let this program go wrong? Code: type ac=^acm; acm=record v1:longint; v2:longint; left,right:ac; end; var a,c:ac; b,d,e,f,g,h,i,j,k,l,m,n,s,p,r:longint; function mln(a:longint):extended; begin if a=0 then exit(a) else exit(ln(a)); end; procedure goal3(m,l,n:longint); var i,j,b,p:longint; procedure goal1(var a:ac); begin if a=nil then begin new(a); a^.left:=nil; a^.right:=nil; a^.v1:=b; a^.v2:=p; inc(s); end else if b=a^.v1 then else if b<a^.v1 then goal1(a^.left) else goal1(a^.right); end; begin j:=m div 11; i:=m-j; if i div 10=j then begin b:=i*l+n div 2; p:=j*l+n div 2; if trunc(mln(b)/mln(10))+1>trunc(mln(p)/mln(10))+1 then goal1(a); end; if (m div 10>0)and not odd(m mod 10) then goal3(m div 10,l*10,(m mod 10)*l+n); if (m div 10>1)and not odd(m mod 10) then goal3(m div 10-1,l*10,(m mod 10+10)*l+n); end; procedure goal2(a:ac); var i:longint; begin if a^.left<>nil then goal2(a^.left); if a<>nil then begin write(a^.v1,' + '); for i:=trunc(mln(a^.v2)/mln(10))+2 to trunc(mln(a^.v1)/mln(10)) do write('0'); writeln(a^.v2,' = ',k); end; if a^.right<>nil then goal2(a^.right); end; begin read(m); k:=m; s:=0; a:=nil; goal3(m,1,0); writeln(s); goal2(a); end. | Страница 1 | Some tests | Carbon | 1189. Pairs of Integers | 30 янв 2008 17:23 | 1 | Here are some tests: 10 1 10 + 0 = 10 21 0 43 0 100 3 91 + 9 = 100 95 + 5 = 100 100 + 00 = 100 4444 6 3722 + 722 = 4444 4022 + 422 = 4444 4037 + 407 = 4444 4040 + 404 = 4444 4042 + 402 = 4444 4222 + 222 = 4444 6667 1 6061 + 606 = 6667 6668 6 5834 + 834 = 6668 6034 + 634 = 6668 6059 + 609 = 6668 6062 + 606 = 6668 6064 + 604 = 6668 6334 + 334 = 6668 66667 1 60607 + 6060 = 66667 66668 7 58334 + 8334 = 66668 60334 + 6334 = 66668 60584 + 6084 = 66668 60604 + 6064 = 66668 60608 + 6060 = 66668 60634 + 6034 = 66668 63334 + 3334 = 66668 52525252 11 46262626 + 6262626 = 52525252 47747626 + 4777626 = 52525252 47750126 + 4775126 = 52525252 47750176 + 4775076 = 52525252 47750226 + 4775026 = 52525252 47750231 + 4775021 = 52525252 47752626 + 4772626 = 52525252 47762626 + 4762626 = 52525252 47812626 + 4712626 = 52525252 48262626 + 4262626 = 52525252 51262626 + 1262626 = 52525252 456000 10 378000 + 78000 = 456000 408000 + 48000 = 456000 413000 + 43000 = 456000 414500 + 41500 = 456000 414545 + 41455 = 456000 414546 + 41454 = 456000 414550 + 41450 = 456000 414600 + 41400 = 456000 415000 + 41000 = 456000 428000 + 28000 = 456000 123000321 1 111818474 + 11181847 = 123000321 200020002 16 150010001 + 50010001 = 200020002 181510001 + 18510001 = 200020002 181835001 + 18185001 = 200020002 181836351 + 18183651 = 200020002 181836366 + 18183636 = 200020002 181836371 + 18183631 = 200020002 181836401 + 18183601 = 200020002 181836501 + 18183501 = 200020002 181837001 + 18183001 = 200020002 181840001 + 18180001 = 200020002 181860001 + 18160001 = 200020002 181910001 + 18110001 = 200020002 182010001 + 18010001 = 200020002 185010001 + 15010001 = 200020002 190010001 + 10010001 = 200020002 200010001 + 00010001 = 200020002 1000000000 13 905000000 + 95000000 = 1000000000 909050000 + 90950000 = 1000000000 909090500 + 90909500 = 1000000000 909090905 + 90909095 = 1000000000 909090910 + 90909090 = 1000000000 909090950 + 90909050 = 1000000000 909091000 + 90909000 = 1000000000 909095000 + 90905000 = 1000000000 909100000 + 90900000 = 1000000000 909500000 + 90500000 = 1000000000 910000000 + 90000000 = 1000000000 950000000 + 50000000 = 1000000000 1000000000 + 000000000 = 1000000000 | How can i do faster? | Yashar Abbasov | 1189. Pairs of Integers | 16 авг 2008 01:00 | 2 | I submitted several times but got TL#4. Where is my fault? var r,p,m,n,i:longint; kod:integer; j:shortint; q,s,t:string[10]; st:array [1..1000000] of string[50]; begin readln(n); str(n,q); r:=1; for i:=1 to length(q)-1 do r:=r*10; i:=n-r; repeat inc(i); str(i,s); j:=0; repeat inc(j); t:=s; delete(t,j,1); val(t,m,kod); if m+i=n then begin inc(p); st[p]:=s+' '+'+'+' '+t+' '+'='+' '+q; break; end; until j=length(s); until i=n; writeln(p); for i:=1 to p do writeln(st[i]); end. What's the min value of the first number. I mean it's min value according to N Edited by author 22.11.2007 14:40 Simple Problem. Just solve it. Go from last digits to first. | How can i do faster? | Yashar Abbasov | 1189. Pairs of Integers | 22 ноя 2007 14:37 | 1 | | Who can help me with the 4th test? | terro | 1189. Pairs of Integers | 20 ноя 2007 17:44 | 1 | Wrong Answer with test 4. I don't know what happened. So who can help me with it? | Compilation Error | Trần Quang Chung | 1189. Pairs of Integers | 8 июн 2006 08:22 | 2 | In BP7, I can run e.g test. But submit "Compilation Error". Why?. My code: mail : chungtq_2712@yahoo.com.vn [code deleted] Edited by moderator 08.06.2006 08:23 In FPC and Delphi "Result" is a standard variable for function result. Sure within function "Find" a variable "Result" has the same type as function, i.e. "bb", but not "li" despite the fact that there is a global variable "ReSult" of "li" type. P.S. And I have already told you to see FAQ for a guide how to investigate a reason of CE: http://acm.timus.ru/faq.aspx | What's the fourth case | Huang SX | 1189. Pairs of Integers | 17 апр 2012 19:23 | 2 | i don't know where could be wrong | Time Limit Exceeded , HELP !!! | TJump | 1189. Pairs of Integers | 16 май 2004 21:55 | 2 | My program got time limit exceeded. Can anybody tell me how to solve this problem without TLE , ( or give me some hints )please ? ...Thank you... I can give you the tests if you want, but this doesn't solves your TLE... | What is correct answer for 353453558? | Roman | 1189. Pairs of Integers | 14 авг 2003 09:34 | 3 | 17 276726779 + 76726779 = 353453558 316726779 + 36726779 = 353453558 320726779 + 32726779 = 353453558 321226779 + 32226779 = 353453558 321276779 + 32176779 = 353453558 321316779 + 32136779 = 353453558 321320779 + 32132779 = 353453558 321321279 + 32132279 = 353453558 321321379 + 32132179 = 353453558 321321409 + 32132149 = 353453558 321321414 + 32132144 = 353453558 321321417 + 32132141 = 353453558 321321429 + 32132129 = 353453558 321321779 + 32131779 = 353453558 321326779 + 32126779 = 353453558 321726779 + 31726779 = 353453558 326726779 + 26726779 = 353453558 | who can tell me some hint with 1189 | ACer | 1189. Pairs of Integers | 8 июл 2004 04:55 | 2 | First, in one solution if you remove the last digit of the longer number, it will be the same as the shorter one. In this case the shorter one is (n div 11). Now if you force the last digits of both numbers are the same, it can only be (n div 2 mod 10) or (n div 2 mod 10+5). Store this as a suffix, cut the last digit off n, and do all above for the new but smaller n. I don't know if I have explained it clearly. If you still have questions, please mail maigoakisame@yahoo.com.cn | must I write the '0' | Milly | 1189. Pairs of Integers | 31 янв 2003 10:10 | 3 | if the output contains the line below, must i write the '0' in the number'01'?or just write'201 + 1 = 202'?HELP!! 201 + 01 = 202 i hadn`t try to solve this problem, before... and it is firs time i read this problem (1189), but: if you read problem carefully ;) you will find in samples it writes: Sample Input 302 Sample Output 5 251 + 51 = 302 275 + 27 = 302 276 + 26 = 302 281 + 21 = 302 301 + 01 = 302 ~~~~~~~~~~~~~~~ and so in last line of output it writes(301 + 01 = 302 ) :P so i believe you should write '0'. Sincerely Aidin_n7 For example, for input 300 you are to output: 5 250 + 50 = 300 273 + 27 = 300 275 + 25 = 300 280 + 20 = 300 300 + 00 = 300 | if input=800,100168 what's the output? | gc007 | 1189. Pairs of Integers | 16 мар 2016 19:03 | 3 | 800 5 725 + 75 = 800 728 + 72 = 800 730 + 70 = 800 750 + 50 = 800 800 + 00 = 800 100168 8 90584 + 9584 = 100168 91034 + 9134 = 100168 91059 + 9109 = 100168 91062 + 9106 = 100168 91064 + 9104 = 100168 91084 + 9084 = 100168 95084 + 5084 = 100168 100084 + 00084 = 100168 |
|
|