Общий форумTry the test 8 1 7 4 6 3 5 2 8 and 8 8 2 5 3 6 4 7 1 . Both tests have solutions. 1000000000 1000000000 1000000000 0 0 0 answer: It is a kind of magic Please give me some tests, my program passed all the tests on the forum Edited by author 22.07.2020 04:11 3 3:00:00 4:00:00 12:00:00 answer: 4:00:00 4 1:00:00 6:00:00 6:00:00 12:00:00 answer: 6:00:00 3 1:00:00 6:00:00 12:00:00 answer: 1:00:00 you don't know how to write bfs, try watching videos for beginners Try this test: 9 6 2 3 2 5 3 4 1 6 1 Answer: 8 1 6 1 2 2 5 3 4 3 try this: sample input: 2 -1 -2 -3 -4 sample output: -1 Код идеален но не проходил 5 тест. Писал на пайтоне. Просто ради эксперимента к sys.stdin.read() добавил стрип - sys.stdin.read().strip() и вуаля - AC. По условиям задачи, замечу, вроде так быть не должно. Если нужен сам рабочий код - пишите I spent 20 submissions, because of TLE15. I tried many fft implementations. But the error was in my z function In a task it is told that a way of departure (1; 1) though, actually, the way of departure has to be (0; 0) Nop, he is starting out from the south-west corner of the 1;1 quarter Isn't that the same as 0;0? My bee had to make only 200 flights, if you know what I mean :) 100 flights wasn't enough to get AC n = int(input()) sp = [] c = 0 for i in range(n): b = input() sp.append(b) sp.sort() for i in sp: if sp.count(i) >= 2 and c == 0: print(i) c = 1 if sp.count(i) < 2: c = 0 Pascal var a,b: array[1..100] of string; i,j,k,n: integer; s: string; f: boolean; begin readln(n); for i:=1 to n do begin readln(s); f:=false; for j:=1 to n do if a[j] = s then f:=true; if f = false then a[i]:=s else begin f:=false; for j:=1 to n div 2 do if b[j] = s then f:=true; if f = false then b[i]:=s; end; end; for i:=1 to n div 2 do if b[i] <> '' then writeln(b[i]);
end. please can anyone give me test #13? oh i found the test 9 000123000 --------- 123000000143 (my program) no good epsilon for this problem use big integers. The first day has no delay flight from the day before. 2 1 60 100 23:00 He can departure from 24:00 , not 00:00 Using long long hashes, any ideas? brute-force solution with bitsets gets AC in 0.187 sec I've solved this problem finally, of course, but I still suppose its definition to be unclear a bit :) So some tests for you: 1 3 1 1 1 1 // 1 5 1 2 3 4 5 // 1 5 5 4 3 3 3 1 // 1 7 1 2 2 3 3 4 5 1 // 1 5 1 2 3 2 1 2 // 1 6 1 2 3 2 3 4 2 - that's the point! // 1 6 3 2 1 4 4 5 2 // 1 6 1 2 1 2 1 2 3 // 1 6 1 2 3 1 2 1 3 Thank you. I've solved this problem finally too. The problem statement is quite ambiguous. Thank you for clarification. Thank you for tests! Who has problem with test 9 - use test 1 12 1 2 3 3 2 1 1 2 3 4 5 4 Answer - 4 Thanks! Problem statement really lacks definition for flat slopes... Thanks! Если честно, то условие ваще дурацкое. >> 1 6 1 2 3 2 3 4 2 - that's the point! >> Why so? =( I know, that problem of my solution in this but don't understand.. I think it should be 3. cause it can be divided in (1,2,3) and (2,3,4) > 1 6 > 1 2 3 2 3 4 Well, I see, it can be divided into (1, 2, 3) and (2, 3, 4). But I don't see anything in the statement, that restricts me to divide into (1, 2), (3, 2), (3, 4). Does this mean, that complexity should be minimal? Then why cant it be divided into (1,2) , (3,2) , (3) , (4) ? Because (1,2) , (3,2) , (3) , (4) = complexity 4 is not optimal Less complexity is: (1,2) , (3,2) , (3,4) = complexity 3 Optimal is: (1,2,3) , (2,3,4) = complexity 2 It is not necessary to connect point #3 and point #4 Hi! 1 3 2 10 5 ->2 * 1 5 20 20 200 20 200 ->2 * 1 5 1 2 2 1 1 ->2 * This test helped me to overcome WA21: input: 1 7 2 2 1 2 2 1 2 output: 3 Thanks for the test cases. Agreed. The problem is easy, but the sample I/O is very misleading. |
|