Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
If you have RE/WA at test #26 | Keworker `~ | 1274. Fractional Arithmetic | 31 июл 2024 13:33 | 1 |
I use Python function .isdigit() to check if fraction is integer, but strings like "-12" gives False for .isdigit() check. So, in test 26 one of the fractions is something like -x, where x is integer. Edited by author 31.07.2024 13:33 |
Wrong Answer 30 | Mahilewets | 1274. Fractional Arithmetic | 20 май 2017 12:49 | 2 |
Hi, I tried all the tests can be found in that discussion. My program gives always the right answers. I am using Python, so, there can't be any integer overflow. I am using gcd function from Fractions.
I rewrote my Python3 program in C++. It got AC immediately. |
WA # 36 | Hakobyan Tigran (RAU) | 1274. Fractional Arithmetic | 1 окт 2015 20:30 | 3 |
WA # 36 Hakobyan Tigran (RAU) 2 янв 2011 17:26 Please somebody give test 36 || some hint to pass this test! Thank you very much! Edited by author 02.01.2011 17:54 WA #36 is a result of something like 11 + 12 --> 23 0/1 I threw away the 0/1 part for such cases and got AC. |
To Admins. | Abdullajon | 1274. Fractional Arithmetic | 2 май 2015 12:38 | 1 |
My AC solution gives wrong answer for this test case: 1/2 - 1/3 my answer: -1/6 Add this test... |
No subject | Nodirbek Islomov (TUIT) | 1274. Fractional Arithmetic | 8 дек 2014 22:43 | 1 |
No subject Nodirbek Islomov (TUIT) 8 дек 2014 22:43 |
WA#25 | askhatik | 1274. Fractional Arithmetic | 6 июл 2013 22:49 | 1 |
WA#25 askhatik 6 июл 2013 22:49 try this test: 11 + 11 ##### 22 |
WA #30 | Rouk | 1274. Fractional Arithmetic | 17 авг 2012 02:13 | 1 |
I have WA #30, but on all tests and on same tests my solution give right answers. Can be there others tricks? |
WA #1 Please help! | Rouk | 1274. Fractional Arithmetic | 16 авг 2012 15:05 | 1 |
Hello! The code works correctly. Checked on many examples. Most likely something with input-output. Prompt, where it is wrong and how it is better to make fraction input? Code C++ Sorry for Russian comments //структура дроби struct Fractional { //объявление целой части, числителя и знаменателя long long intPart, numerator, denomerator; } _oneFract, _twoFract, _result; //функция считывания дроби Fractional ReadFractional() { Fractional _fract; //переменная _razdel определяет, что ввели: только целую часть, только дробную часть или целую и дробную часть char _razdel; //считываем первое число scanf("%lld%c",&_fract.intPart, &_razdel); //считываем разделитель после первой цифры: если нажат Enter, то число без дробной части, //если слеш, то только дробная часть, если пробел то и целая и дробная части присутствуют if (_razdel == '\n') { _fract.numerator = 0; _fract.denomerator = 1; } else if (_razdel == ' ') { //Считываем дробную часть scanf("%lld/%lld%*c", &_fract.numerator, &_fract.denomerator); if (_fract.denomerator == 0) _fract.denomerator = 1; } else if (_razdel == '/') { //Считываем знаменатель scanf("%lld%*c", &_fract.denomerator); if (_fract.denomerator == 0) _fract.denomerator = 1; _fract.numerator = _fract.intPart; _fract.intPart = 0; } //Сбрасываем входной поток fflush(stdin); return _fract; } |
WA on test #1 | Rouk | 1274. Fractional Arithmetic | 15 авг 2012 17:19 | 1 |
Please help me! I think the problem with the input / output. post the code sorry for the Russian comments. INPUT //структура дроби struct Fractional { //объявление целой части, числителя и знаменателя long long intPart, numerator, denomerator; } _oneFract, _twoFract, _result; //функция считывания дроби Fractional ReadFractional() { Fractional _fract; //переменная _razdel определяет, что ввели: только целую часть, только дробную часть или целую и дробную часть char _razdel; //считываем первое число scanf("%lld",&_fract.intPart); //считываем разделитель после первой цифры: если нажат Enter, то число без дробной части, //если слеш, то только дробная часть, если пробел то и целая и дробная части присутствуют scanf("%c", &_razdel); if (_razdel == '\n') { _fract.numerator = 0; _fract.denomerator = 1; } else if (_razdel == ' ') { //Считываем дробную часть scanf("%lld/%lld", &_fract.numerator, &_fract.denomerator); if (_fract.denomerator == 0) _fract.denomerator = 1; } else if (_razdel == '/') { //Считываем знаменатель scanf("%lld", &_fract.denomerator); if (_fract.denomerator == 0) _fract.denomerator = 1; _fract.numerator = _fract.intPart; _fract.intPart = 0; } //Сбрасываем входной поток fflush(stdin); return _fract; } OUTPUT if (_result.intPart == 0) { if (_result.numerator == 0) { printf("0"); } else { printf("%lld/%lld", _result.numerator, _result.denomerator); } } else if (_result.numerator == 0) { printf("%lld",_result.intPart); } else { printf("%lld %lld/%lld",_result.intPart, _result.numerator, _result.denomerator); } The answers are checked and correct Edited by author 15.08.2012 17:22 |
One hint against WA | Oleg Strekalovsky [Vologda SPU] | 1274. Fractional Arithmetic | 28 ноя 2010 22:12 | 9 |
After my wrong AC tests were added (Thanks to Fyodor Menshikov). Many authors lost AC.The problem was with division to negative divisors. (Example) 1/2 / -1/3 Good luck! I have WA #30, but on your test and on same tests my solution give right answers. Can be there others tricks? Try these tests: INPUT: 30000 29999/30000 * 30000 29999/30000 OUTPUT: 900059998 899940001/900000000 INPUT: 30000 29997/30000 / 1/29999 OUTPUT: 899999996 1/10000 Edited by author 05.05.2009 04:36 Thanks! You helped me a lot. Yes, I see. But I achieved the target - helped to the guys to find their bugs and get AC =) My program passed these tests, but it still has WA#29. (Before rejudge it has AC status). Does anybody have other hints or tests? OUCH! But on test 30000 29999/30000 * -30000 29999/30000 my prog outputs -20745377/900000000 instead of -900059998 899940001/900000000 hmm... thank you for good tests, Vedernikoff Sergey :) Now it's OK, just stupid mistake with labs function I saw with a help of this test. I don't know why it works wrong with long long numbers. I'll not use it anymore! Edited by author 06.03.2010 01:05 Edited by author 06.03.2010 01:06 thanks, first i WA#26 but when i see your test got AC, thanks, i dont forgot your help in all my life ;) sorry for my poor english. |
I have AC use 0.031s and 377 KB. ^_^ | marina_ufa | 1274. Fractional Arithmetic | 24 мар 2010 11:42 | 4 |
I'm veru happy!!! But anyone got AC fast? 0.015s and less memory I'm verY happy too... ;))) |
Some TEST for WAer | TheBeet | 1274. Fractional Arithmetic | 14 фев 2010 12:12 | 2 |
-5/7 + -5/7 ###### -1 3/7 0 / -1 25/31 ###### 0 1/7 * -49 7/9 ##### -7 1/9 -11 1/8 / -11 1/8 ##### 1 for test 1/7 * -49 7/9 ##### -7 1/9 answer -6 8/9 is rigth? |
Brain-damaged compiler! (2 all who has WA29 or WA30) | ftc | 1274. Fractional Arithmetic | 13 сен 2009 20:05 | 1 |
In this compiler built-in abs() function casts its argument to int, so if you will pass long long there, it will not work. Take care of it and pass tests #29 and 30. |
FOR EVERYBODY WITH WA 29 | Elisabeth | 1274. Fractional Arithmetic | 16 июл 2009 02:26 | 1 |
If you have WA 29, use long long integer variable and if you haven't other bugs, you'll get AC :) Edited by author 16.07.2009 03:16 |
WA#11 | Lord | 1274. Fractional Arithmetic | 21 июн 2009 18:40 | 2 |
WA#11 Lord 21 июн 2009 18:13 Who knows test data for test #11?? I got WA many times already on this test. Edited by author 21.06.2009 18:13 Aaaahh, mistaked in code))))) AC already. |
Wrong answer#29 | Nisarg Shah | 1274. Fractional Arithmetic | 31 май 2009 13:58 | 1 |
Hi..I had got my accepted solution rejudged and got WA#25. Then I corrected a mistake and now it is giving WA#29. Can somebody please give me a hint about test #29? |
Wrong answer #30 | Dmitriy Maksimov | 1274. Fractional Arithmetic | 16 апр 2009 19:55 | 1 |
I solved the problem some time ago, but recently I received a letter that my solution is rejudged. Now I got WA#30, but my program looks correct. Any ideas about test #30? |
Problem 1274 Fractional Arithmetic rejudged | Vladimir Yakovlev (USU) | 1274. Fractional Arithmetic | 9 апр 2009 12:17 | 1 |
New tests have been added. Accepted solutions have been rejudged. 295 authors have lost AC after rejudge. |
Wonderful Problem! | bsu.mmf.team | 1274. Fractional Arithmetic | 14 мар 2009 23:32 | 1 |
It is not so easy as it seems at first, but if you could separate all symbols and all numbers (I think this is the most difficult part of this task) - you'll get success! Some tests: IN: -2008/2009 - -2008/2009 OUT: 0 IN: 8/9 * 9/4 OUT: 2 IN: 7/10 / -10/7 OUT: -49/100 IN: 1 1/3 + 3 5/6 OUT: 5 1/6 |
To admins | Sergey Lazarev (MSU TB) | 1274. Fractional Arithmetic | 17 фев 2009 20:47 | 2 |
To admins Sergey Lazarev (MSU TB) 16 фев 2009 21:31 My AC program gives 10/15 to the test 10/15 * 1 real answer is 2/3 |