| Show all threads Hide all threads Show all messages Hide all messages |
| WA#4 | vessel | 1471. Distance in the Tree | 8 Dec 2018 11:57 | 2 |
WA#4 vessel 6 Dec 2006 18:05 wa#4 for countless times, seek for kind help! thanks Re: WA#4 MOPDOBOPOT (USU) 8 Dec 2018 11:57 |
| Что не правильно? паскаль | Lena | 1283. Dwarf | 7 Dec 2018 22:02 | 2 |
var a,b,c,i,k:real; begin read(a,b,c); while a>b do begin a:=a-(a*c/100); I:=i+1; end; write(i); end. variable i should be integer ! |
| What's wrong? | Markfryazino | 1283. Dwarf | 7 Dec 2018 21:58 | 2 |
Here is the code (python 3.6). Can anyone explain, why it fails on test 9? import math string = input().split() start = int(string[0]) end = int(string[1]) commission = int(string[2]) if start <= end: n = 0 else: q = 1 - commission / 100 n = math.log((end / start), q) n = round(n) print(n) Use float / double instead of int ! |
| WA47 | German | 2102. Michael and Cryptography | 7 Dec 2018 17:07 | 6 |
WA47 German 27 Feb 2017 14:20 1) Find the prime numbers up to 10,000,100 (Sieve of Eratosthenes) 2) if the sum is equal to 19 degrees, then the residue is prime to check What can you advise? 1) Up to 10M? 2M is enough. sqrt( 10^18 / 2^18) ~= 1.5M 2) "Yes" precondition: N > 1 "Yes" condition: sum is 20 and residue is 1 "Yes" condition: sum is 19 and residue>1 and residue is prime Could you show please code? AC Edited by author 09.03.2017 18:16 > if (kol == 20){ It's suspicious a bit. Please try test (2^20)*3, expected answer is No 3145728 No 20^20 * 3^1 sum 21 if I understand condition of the problem: 3^1*5^1*7^2*11^1*17^12*23^3 answer is "Yes" ? Edited by author 01.03.2017 13:26 |
| Java runtime error - SOLVED | IFrank | 2001. Mathematicians and Berries | 7 Dec 2018 13:58 | 3 |
In Idea my code works, but here is a runtime error: import java.util.Scanner; public class MathematiciansAndBerries { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); byte a1 = scanner.nextByte(); byte b1 = scanner.nextByte(); byte a2 = scanner.nextByte(); byte b2 = scanner.nextByte(); byte a3 = scanner.nextByte(); byte b3 = scanner.nextByte(); System.out.println((a1 - a3) + " " + (b1 - b2)); } } Help pls, why runtime error occurs? Edited by author 06.12.2018 21:47 Changed byte to int and now it works ok here. Idiotic. I don't think a mathematician can bring more than 127 kg)) "0 <= ai, bi <= 10,000" Sure, do not read condition is idiotic. |
| That problem is EVIL | Nikita Mogilevets | 1226. esreveR redrO | 7 Dec 2018 00:34 | 3 |
I think I can not get AC because of "Enter" key on Windows is "\r\n" and C++ scanf() reads it as "\n" and printf() writes "\n" as "\r\n". So, if in input is some "\n", then I would read it as "\n" and then print it as "\r\n"!!! I don't know how to fix that. Also there were problems with EOF-character. Yeah, I have the same problem! My ass is burning after solving this problem |
| Test #11 | DKarev | 1226. esreveR redrO | 6 Dec 2018 23:55 | 2 |
The test is empty. There is nothing there. |
| Wrong Answer (Python 3.3) | Nerlin | 1226. esreveR redrO | 6 Dec 2018 23:41 | 2 |
I really don't understand why my solution is wrong but here it is: letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" start = 0 s = input() for i in range(0, len(s)): if not(s[i] in letters): word = s[start:i] other = s[i:i+1] if (word != ""): print(word[::-1], end="")
print(other, end="") start = i+1 if (start != len(s)): print(s[start:len(s)][::-1], end="") What's wrong with this solution? WA (Test 2) Edited by author 30.03.2013 23:10 I think that the input can be more than one line. |
| test n=48 | ura | 1217. Unlucky Tickets | 5 Dec 2018 23:59 | 1 |
верно ли,что при n=48,ответ 793566522023068987143383410279408208612410000 а при n=100 3834688188199309756675466732967588185862422492337212276545580039517258085033387305291001857619600 |
| To admins: incorrect 'Compilation Error' verdict with Visual C++ 2017 compiler | Smilodon_am [Obninsk INPE] | 1314. Chase in Subway | 4 Dec 2018 01:57 | 1 |
Hello. I have received strange 'Compilation Error' verdict for my solution on the 1314 task under Microsoft Visual C++ 2017 compiler. Compilation log is as follows: ///////////////////////////////////////// lg1vr1-w2nnli(24): error C2062: type 'float' unexpected lg1vr1-w2nnli(84): warning C4244: 'argument': conversion from 'float' to 'const int', possible loss of data lg1vr1-w2nnli(94): warning C4018: '<': signed/unsigned mismatch ///////////////////////////////////////// Lines 23 and 24 of my code are: ///////////////////////////////////////// const int MAX_STATION_ID = 32767L; const int INFINITY = 10L * MAX_STATION_ID; ///////////////////////////////////////// Commits with CE are 8162255, 8162250, 8162248. But there is successful (Accepted) commit 8162257 (the same code as 8162255) under G++7.1 commit. Could you check if the CE message was correct or not? Best regards. Edited by author 04.12.2018 02:01 |
| WA#12 | levandos | 1183. Brackets Sequence | 4 Dec 2018 00:51 | 3 |
WA#12 levandos 21 Jul 2014 09:04 thank you very much. It's just like the test of the compiler. try ()() |
| I solved with brute-force, Can it solve using max-flow ? | coder | 1957. Mundial | 3 Dec 2018 18:22 | 1 |
|
| TLE #20 for Java | Bakhodir Boydedaev | 1330. Intervals | 1 Dec 2018 23:59 | 2 |
if you have TLE #20. Use BufferedReader and Printwriter in Java. Good luck... Thanks a lot! I don't really understand why PrintWriter works faster than System.out... |
| HOWTO AC Java | raggzy | 1074. Very Short Problem | 1 Dec 2018 18:48 | 2 |
Hints for Java'ers who also hates problems like this and doesn't want to write automation-based solution. new BigDecimal(line1) - it's almost cool, but you need some fixes before use constructor 1. Check for empty fraction case, e.g. "1.", "1.e2", "1.E2" - these are NANs according P1074 grammar, but OK according BigDecimal grammar (this is the only difference in grammars). 2. Fix big exponent to something smaller, for BigDecimal to be able to parse it e.g. e1000000000000 => e1000 e-1000000000000 => e-1000 Edited by author 09.02.2013 06:24 can you show your answer? |
| ULTIMATE test for WA12, TLE12, output limit exceeded | Mikhail | 1074. Very Short Problem | 1 Dec 2018 18:40 | 5 |
<input (replace 'S' with spaces!):> S 1 34 10 - 1 -. 1 -.e0 1 -.1e 1 #123 1 --123 1 -1.e6 1 S4 4 12345678e-100000000000000000000000000000 10 0.0e10000000000000000000000 1 # <output:> Not a floating point number 34.0000000000 Not a floating point number Not a floating point number Not a floating point number Not a floating point number Not a floating point number Not a floating point number Not a floating point number Not a floating point number 0.0000000000 0.0 <input> #S 1 S# 1 # <output> Not a floating point number Not a floating point number Thank you so much! very helpful |
| help,wa#2. | William Chou | 1717. Eligibility Rules | 1 Dec 2018 15:23 | 3 |
I use segment tree to solve this problems(O(n^2logn)). And I have checked my program with an solution(already accepted) for many times. All my answer is correct. But still wa#2. Sorry for my poor English. Please help me,Thank you. After I have correct my code. I got wa#85 now!!! faint! Who can help me? For WA #2 one should make sure that the Segment Tree is initialized to -INF. |
| если не трудно,HELP ME Pleees ^_^ ♥♥♥ | Kety Pirozhkova | 1607. Taxi | 1 Dec 2018 15:10 | 3 |
Что нужно поправить,чтобы эта программа реализовывала тест '60 100 300 1'?вообще она ломается на 10 тесте при сдаче, но после того как я посмотрела обсуждения и прогнала её по найденным тестам поняла что не могу реализовать только один выше сказанный ответ кстати (как я думаю) 298. вот тесты на которых пробовала. к стати я очень невнимательная, поэтому сильно на меня не ругаться ))) 150 50 1000 100 ответ - 450 1 4 2 2 ответ - 2 1 3 5 2 ответ - 4 2 1 1 1 ответ - 2 1 3 4 3 ответ - 4 1000 2 2000 3 ответ - 140 11 1 10 2 ответ - 11 4 3 6 1 ответ - 6 1 2 12 3 ответ - 6 var a,b,c,d:integer; begin read(a,b,c,d); if a>c then write(a) else begin while a<>c do begin a:=a+b; if (a>c-d)and(c>a) then c:=a else if a+b>c then a:=c else if a=c then break else c:=c-d; end; write(c); end; end. Заранее спасибо)♥_♥ Edited by author 28.12.2017 21:55 Edited by author 28.12.2017 21:56 Let's take a look at this simple test: 32 36 80 4 The process goes like this: 32 -> 80 -> 32+36=68 -> 80-4=76 -> 68+36=104>76, so the end result is 76. Now, let's take a look at how you handle it. a=32 b=36 c=80 d=4 a:=a+b; -> a = 68 now if (a>c-d)and(c>a) then c:=a -> 68>80-4 is false, so this doesn't trigger else if a+b>c then a:=c -> 68+36=104>80, a becomes 80 here. then, while a<>c is checked again, a = c = 80 at this point, so it jumps to write(c). However, answer is 76 and not 80. Hope this helps you to figure out the problem! 150 50 1000 100 Why in this test answer is 450 (not 500) ? |
| Some hints | Alex Fetisov | 1438. Time Limit Exceeded | 1 Dec 2018 01:43 | 4 |
I had WA4 because of this: AnD <=> and, NOt <=> not, etc. I had WA9 because of this: empty strings (only spaces) - this is not a command)) I had TLE 13 because of this: we should ignore as a command lines has only a label) Cool problem)) Good Luck) Edited by author 07.04.2008 12:41 Well, now you don't have AC :) I can also add that you should do some pre calculations to get access to the variables' values and labels' positions with constant time. Logarithmic complexity isn't enough to pass TL. >Well, now you don't have AC :) Test 14 was added by me recently, which is why~ The only hint i can give for it is that the code prevented TL #13, but did it in not exactly a proper way. Took some time to rewrite that crap and retake AC :) Still don't know what was wrong in TL 14 of the previous solution though. |
| Почему при проверке выбрасывает "Wrong answer"? | Ilya | 1001. Reverse Root | 30 Nov 2018 13:56 | 2 |
#include <iostream> #include <math.h> #include <iomanip> using namespace std; int main(int argc, char const *argv[]) { long number; double sqrts[256]; int k = 0; while ( cin >> number ) { sqrts[k] = sqrt(number); k++; } for ( int n = k - 1; n > -1; n-- ) { cout << fixed << setprecision(4) << sqrts[n] << endl; } return 0; } Edited by author 29.11.2018 20:32 http://acm.timus.ru/help.aspx?topic=cpp C and C++ programs are compiled on the server with the 32-bit Microsoft Visual C++ 2017 or MinGW GCC 7.1 or Clang 4.0.1. So sizeof(long)==4. You should run locally/debug programs using 32 bit compiler too. Btw, why do you think 256 sqrts is enough? How did you estimate it? |
| WA на первом тесте pascalABC. Что не так ? *HELP* | Kety Pirozhkova | 1001. Reverse Root | 28 Nov 2018 21:20 | 1 |
скорее всего ошибка с функцией Eof() ибо впервые ей пользуюсь и смутно представлю принцип работы. Если её нельзя использовать, то как найти конец вводимого файла? var s,sk:string; var i,fl,j,code:integer; var n:real; var a:array [1 ..256] of real; var f:array [1 ..256] of integer; begin while (Eof()<>True ) do begin readln(s); for i:=1 to length(s) do begin if (s[i]<>' ') and (fl=0) then begin fl:=1; sk:=sk+s[i]; end else if (s[i]<>' ') and (fl=1) then sk:=sk+s[i];
if (((s[i]=' ') and (fl=1)))or ((i=length(s))and(fl=1)) then begin fl:=0; val(sk,n,code); for j:=1 to 256 do if f[j]<>1 then begin a[j]:=sqrt(n); f[j]:=1; sk:=''; n:=0; break; end;
end; end;end; for i:=1 to 256 do if (f[i]=1) then writeln(a[i]:0:4); end. |