Common Boarda valid n digit number can be found from valid n-1 and n-2 digit numbers Edited by author 16.02.2021 13:56 Edited by author 16.02.2021 13:56 [DELETED] Edited by author 17.09.2022 01:09 You should find maximum matrix which is square, black and also contains white square inside rotated by 45 degrees. For instance: 1) 1 1 1 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 1 1 1 1 0 1 1 1 2) 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 are desired matrices maximum width of which you must find Easy solution with O(p) and without using a primality of p. We can build a table of square roots modulo p and then... test: 4 0 0 2 0 2 2 0 2 1 2 1 360 ans: 4 0 test: 4 0 0 2 0 2 2 0 2 2 1.5 3 180 -180 -180 ans: 3 1 1 0 Example: 31 9973 31 Why python is VERY slow in mod? Got tle here Hello :) Could someone please give me test 48 or similar to let me understand what is wrong with my program ? :) My program works fast on this test case :) (about 0.5 seconds) but still have TLE 48 ) What is the best way to collect information for particular test? Time/100ms (if there is window for that), memory/100kB, WA, TLE, RE... what else? What maximum number of bits per try? Let's call it `bitrate`. Serious enough term for further discussion =), isn't it? How to match particular test? Binary search for hash value of the input? Please, reveal your super-duper technology with your fancy-nancy metrics. Edited by author 18.12.2017 22:11 Re: test case 70: Posted by Shen Yang 19 Dec 2017 05:08 I just use stupid bianry search every veriable and submit many many many times I don't have better ideas and I have only test case 70... Edited by author 19.12.2017 05:09 Thank you for prompt :) But I guess I found one which helped me: Ships: 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 83, 83, 83, 83, 73, 73, 73, 73, 73, 72, 72, 72, 62, 62, 57, 57, 57, 57, 57, 57, 57, 53, 53, 50, 50, 50, 50, 46, 46, 46, 42, 42, 42, 42, 42, 42, 42, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 24, 24, 24, 22, 22, 22, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 14, 14, 14, 14, 10, 10, 10, 10, 10, 10, 10, 10 Rows: 159, 516, 57, 724, 146, 1014, 688, 507, 1039 Some good test cases: 2 8 3 01100011 00011000 1 2 0 00 Edited by author 07.02.2021 19:15 8 10 4 0000011000 0000110000 0000011000 0000110000 0000000000 0000000000 0000000000 0000000000 You should also try switching N and M (10 8) Edited by author 08.02.2021 16:48 10 10 5 0000000000 1000000000 1100000000 0111100000 0010110000 0000000000 0000000000 0000000000 0000000000 0000000000 AC finally!!! I used a randomized approach, but in the end, I needed to use a special seed. Nice problem, but unfortunately, I wasn't able to find test 74 to share here. Maybe someone could explain why I'm still getting WA 13? On all of tests in this forum i get right answers. Can anyone give more tests? I just figured out that I got WA13 because I assumed that if I get to each node with the minimum steps,I can eventually got to the end point with minimum steps.But this is not always true. Try This test 9 1 2 3 4 1 3 5 6 4 The answers is obviously 1 2 3 4.But my WA13 programme gave the answer 1 3 5 6 4 Hope this helps. I have WA 13 too, but i have correct answer for this test Is there any way I could change my user(Author) name? Update your info -> Login The triangular sequence is behind the scene. n belongs to triangular sequence if and only if (8n+1) is a square. Edited by author 03.02.2021 23:21 Edited by author 03.02.2021 23:21 Edited by author 03.02.2021 23:21 Few lines of code with no conditions The most time I consumed was to prove that naive algorithm works here :) 4 WMC WMC WMC WMC --- 3 Looking for rogue 4 WM WMC WMR MR --- 4 Okey, he lost the page that had the number of the k-th interesting lamppost. So, the input contains one integer k. > Output the number of the k-th interesting lamppost. Sorry, what? What does input `k` mean then? ____ Я вроде бы родился русским, но никак не могу понять условие задачи. Это что, часть задачи - понять что требуется? Да, так и есть. По входным данным надо было понять, что это алгебраческая прогрессия, с шагом в 10074. same use sets it's easy with them Сначала пробовал через множества, потом сократил через map всегда валился на 8 тесте по времени Решил напрячься Сел и написал два модуля, чтобы работать с битами На преподавателе включаю биты На студенте проверяю и прибавляю к ответу Сдаю задачу, уже в предвкушении надписи "Accepted", как тут мои глаза лезут на лоб. Снова "TL8" Что это за монстр такой этот восьмой тест?) Обычный бинарный поиск в этой задаче же. #include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; while(n--){ string s; int a,b; cin>>s; a = s[0]-'a'+1; b = s[1]-'0'; a = min(a,9-a); b = min(b,9-b); if(a==b){ if(a==1) printf("2\n"); else if(a==2) printf("4\n"); else printf("8\n"); } else { if((a==1&&b==2)||(a==2&&b==1)) printf("3\n"); else if((a==1&&b>=3)||(a>=3&&b==1)) printf("4\n"); else if((a==2&&b>=3)||(a>=3&&b==2)) printf("6\n"); else if(a>2&&b>2)printf("8\n"); } } return 0; } |
|