| Show all threads Hide all threads Show all messages Hide all messages |
| WA3 | 👑TIMOFEY👑`~ | 1592. Chinese Watches | 30 Oct 2023 09:51 | 1 |
WA3 👑TIMOFEY👑`~ 30 Oct 2023 09:51 we have 12 hours on clocks |
| WA10 | Yury_Semenov | 1678. Space Poker 3 | 28 Oct 2023 15:22 | 1 |
WA10 Yury_Semenov 28 Oct 2023 15:22 If you have WA10, make sure you don't have 'I' as a card value instead of 'T'. For some reason it was very easy for me to mix these letters in the statement... |
| how do it more simply | 👑TIMOFEY👑 | 1116. Piecewise Constant Function | 27 Oct 2023 01:13 | 2 |
u can search for intersections instead of looking for cutouts, just invert the segments of the second function use min max instead of a lot of conditions and you get a very simple code :) Simpler is to brute-force |
| Does the greedy solution work? | InstouT94 | 1782. Jack's New Word | 21 Oct 2023 16:50 | 1 |
My idea is to reverse the operations of adding characters and doubling a string. I have an iterative algorithm in O(n * log(n)). At each iteration, I count dp - the length of the maximum substring ending with index i, obtained by the doubling operation. Then I look for the maximum among the maximum substrings and truncate the current string to leave this substring. But this is a greedy solution. Is it possible to come up with a counterexample to it? |
| checker failed | юри пустовалив | 1954. Five Palindromes | 21 Oct 2023 01:29 | 1 |
admins, could you pls fix this? |
| Little Guide | Mickkie | 2042. Nikita | 21 Oct 2023 00:05 | 1 |
My first attempt use string hashing to check the palindrome with Segment Tree lazy prop. O(Q*K*logK*logN), esp. for the update query and it's TLE 11 However, using Manacher algorithm with Segment Tree you can achieve O(Q*(K+lgN)) Little help: - WA#3 : You're likely answering too much. (K involved) - WA#9 : N=10^5, overflow somewhere |
| WA №16 | Delpher | 1497. Cutting a Square | 20 Oct 2023 17:05 | 4 |
WA №16 Delpher 27 Apr 2011 14:41 Help! What is wrong? [code deleted] Edited by moderator 05.11.2023 02:38 maybe this test can halp you? 5 00000 01111 01111 01110 00000 I also had WA 16, turns out this was the reason: 5 11100 10000 00011 11000 00000 In this test, i assumed that you can move away parts with 1's, thus separating 0's from everything. But it turns out to be wrong, you're only allowed to move zeros, and ones stay fixed in place. |
| Помогите пожалуйста, разве это неверное решение (PascalABC) | Ahmet | 1068. Sum | 19 Oct 2023 22:38 | 1 |
var N: integer; begin readln(n); if (abs(n)>10000) then writeln('Îøèáêà ââîäà') else if N>=0 then writeln(((1+n)*n)/2) else writeln(((1+n)*(abs(n)+2))/2); end. |
| Почему не засчитывает?Why does not count?№1068.PascalABC | Yura | 1068. Sum | 19 Oct 2023 22:35 | 3 |
var a: integer; b: real; begin readln(a); if (abs(a) < 10001) then begin if (a < 0) then b := (a + 1) * (-a + 2) / 2 else b := 0; if (a > 0) then b := (a + 1) * a / 2 else if (a < 0) then b := (a + 1) * (-a + 2) / 2 else b := 1; writeln(b); end; end. Я так понимаю, ты используешь тип real для b, потому что / не работает. Следует помнить, что для целочисленного деления нужно использовать div, а не /. То есть, вариант 1 — заменить b: real на b: integer и все / на div. Вариант 2 — можно продолжать использовать /, но вместо writeln(b) следует написать writeln(b:0:0) (второе :0 — количество знаков после запятой для вывода). Также, проверки типа if (abs(a) < 10001) не нужны — если в задаче сказано о таком ограничении на входные данные, значит в тестах так честно и будет, и не нужно это проверять. А у меня тоже такая же проблема: var N: integer; begin readln(n); if (abs(n)>10000) then writeln('Îøèáêà ââîäà') else if N>=0 then writeln(((1+n)*n)/2) else writeln(((1+n)*(abs(n)+2))/2); end. IS that wrong answer? |
| Hint | Mickkie | 2166. Two Roads | 18 Oct 2023 18:15 | 1 |
Hint Mickkie 18 Oct 2023 18:15 Read article: convex hull of n*(n-1)/2 intersection points of n lines Implementation is very easy. But the proof is cool to read. |
| WA 9 | Mortus | 1440. Training Schedule | 17 Oct 2023 15:18 | 1 |
WA 9 Mortus 17 Oct 2023 15:18 spell the months correctly |
| WA 19 | alexxey | 1297. Palindrome | 16 Oct 2023 00:23 | 1 |
WA 19 alexxey 16 Oct 2023 00:23 |
| What's wrong with my code? WA#9 | Artem Bakhretdinov | 1118. Nontrivial Numbers | 15 Oct 2023 23:28 | 1 |
#include <iostream> #include <limits> #include <cmath> bool isPrime(int n) { if (n <= 1) { return false; }
for (int i = 2; i * i <= n; i++) { if (n % i == 0) { return false; } }
return true; } int lowest_trivia_number (int I, int J) { double min_trivia = std::numeric_limits<double>::max(); int res = 0; for (int i = I; i <= J; i++) { int sum_of_own_denominators = 1; for(int j = 2; j <= std::sqrt(i); j++){ if(i % j == 0) { sum_of_own_denominators += j; if(j != i / j) { sum_of_own_denominators += i / j; } } } double cur_trivia = sum_of_own_denominators/i; if (cur_trivia < min_trivia) { min_trivia = cur_trivia; res = i; } } return res; } int main() { int I, J;
std::cin >> I >> J; if(I == 1) { std::cout << 1; return 0; } int largestPrime = -1; for (int num = J; num >= I; num--) { if (isPrime(num)) { largestPrime = num; break; } } if (largestPrime != -1) { std::cout << largestPrime << std::endl; } else { std::cout << lowest_trivia_number(I, J); } return 0; } |
| O(N^2 logN) Time | Mickkie | 2165. Cake Cutter | 13 Oct 2023 00:50 | 1 |
|
| I got it by precalc, but wanna know smart solution | Apkawa | 1150. Page Numbers | 10 Oct 2023 12:33 | 2 |
I precalculated digits for segment from 1e5 to 2e5, then i computed all digits from 1 to 1e5(if n >= 1e5), then i stepped from 1e5 to n with step size = 1e5. And after all this I computed digits from last step to n. It does about 1e9/1e5 steps and works 0.015 sec. I think that it's dumb solution, so I want to know, how to solve this task in O(log10(n)) or smth similar. Two ways I know - 1) Solve for each number of digits 2) Better way (hint): 1 to 10, 11 to 20, etc. each digit is counted once in the ones place Edited by author 10.10.2023 12:37 Edited by author 10.10.2023 12:37 |
| Why WA on test 6? | SpaceFlyer | 1439. Battle with You-Know-Who | 9 Oct 2023 13:54 | 6 |
I wrote two programs, one AC, one WA. I run these two programs for many times but they always make the same answer. Is it strange? Two test for you: ---Test 1--- 4 4 D 1 D 2 L 1 L 2 ---Test 2--- 4 4 D 2 D 1 L 1 L 2 Output 1: 2 4 Output 2: 3 4 Edited by author 01.04.2006 13:51 Thank you! Edited by author 05.08.2006 10:55 deleted Edited by author 13.12.2019 21:18 |
| Why Rintime Error!&!?!?!?! (python) | Dmitriy | 1800. Murphy's Law | 7 Oct 2023 21:16 | 1 |
a= input().split() l = int(a[0]) h = int(a[1]) ω = int(a[2]) g = 9.81 ω = ω * 2 * 3.14159 / 60 t = (h / 100) / (g * 0.5) x = ω * t * l if x % l <= l/2: print("butter") else: print("bread") |
| help (python) | quarylaniel | 1910. Titan Ruins: Hidden Entrance | 7 Oct 2023 11:31 | 2 |
why do I get runtime error? n = int(input()) for i in range (n) : a=list (map (int,input().split())) a.sort() c = a[::-1] d = c[0] + c[1] + c[2] e = (len(c) // 2) print(d, e) WA eremeev.me.2012@gmail.com 7 Oct 2023 11:31 EOF when reading a line 3 |
| Help me (Python) | ArtemNazarov | 1880. Psych Up's Eigenvalues | 7 Oct 2023 11:27 | 4 |
Time limit. Where is my mistake? cnt1 = int(input()) lst1 = input() lst1 = lst1.split() cnt2 = int(input()) lst2 = input() lst2 = lst2.split() cnt3 = int(input()) lst3 = input() lst3 = lst3.split() cnt = 0 for i in range(cnt1): for j in range(cnt2): if lst1[i] == lst2[j]: for k in range(cnt3): if lst1[i] == lst3[k]: cnt += 1 else: continue print(cnt) Edited by author 31.10.2017 14:42 Your code has O(cnt1 * cnt2 * cn3). If cnt1 is 4000, cnt2 is 4000, cnt3 is 4000, Your code will work (4000*4000*4000)/10^8 seconds. 640 seconds. 640 > 0.5 I agree 640>0.5 Edited by author 15.07.2018 02:43 Edited by author 15.07.2018 02:43 Ac eremeev.me.2012@gmail.com 7 Oct 2023 11:27 a = input() A = list(map(int , input().split())) a = input() B = list(map(int , input().split())) a = input() C = list(map(int , input().split())) print(len(set(A) & set(B) & set(C))) |
| Is it possible to get wrong answer because of rounding numbers? | roman velichkin | 2099. Space Invader | 6 Oct 2023 17:43 | 2 |
Vectors calculations uses square roots. Could this lead to not very precise floats and wrong results? Edited by author 05.10.2023 13:50 Edited by author 05.10.2023 13:50 In this sort of problems rounding errors could be the source of problems. That's why you shall avoid using float types here. The problem is completely solvable in integers. |