| Show all threads Hide all threads Show all messages Hide all messages |
| WA4 | reshke'` | 2060. Subpalindrome pairs | 15 May 2020 15:38 | 2 |
WA4 reshke'` 12 Mar 2018 20:58 Does anyone know what this could be related to? Re: WA4 Alikhan Zimanov 15 May 2020 15:38 I found the following test when got WA4: INPUT: aaa OUTPUT: 4 |
| time exceeded。。can you help me make it faster? | xinxin | 1131. Copying | 15 May 2020 04:21 | 3 |
#include<stdio.h> #include<math.h> int main() { int n,k,i=1,s=1,t=0,temp=0; scanf("%d %d",&n,&k);
while(i<k) { s=s+i; i=2*i; t++;
if(s>=n) break; } while(s<n) { s=s+k; t++; } printf("%d",t); return 0; } while(s<n) { s=s+k; t++; } Isn't here (n-s)/k iterations? #pragma optimize( "g", on ) |
| How to find minimum teams using SCC? | ajay jadhav | 1742. Team building | 14 May 2020 20:45 | 1 |
I got AC for maximum temas using Kosaraju. and for minimum I started with nodes with no incoming edge and searched until it hit previously found node (cycle) this is 1 team. For disconnected cycles, run dfs in similar fashion incrementing teams by 1. |
| Hint | Ishmeet Singh Saggu | 1742. Team building | 14 May 2020 19:47 | 2 |
Hint Ishmeet Singh Saggu 28 Apr 2020 22:51 This question requires knowledge of Strongly Connected Component. If you don't know read about it. Good Luck !!! for max = number of strongly connected components. for min = ? |
| Error on submission with default core Java | Jose_Silva | 2004. Scientists from Spilkovo | 14 May 2020 17:50 | 1 |
Hi, I have submitted one solution with: new String("0").repeat(n) => n is one number, and the system not know repeat method for Java 1.8, what's about that?! It's core Java. Thanks, Jose |
| If you have WA #6 | PrankMaN | 1998. The old Padawan | 14 May 2020 13:02 | 1 |
> They fall until the total weight of the fallen stones exceeds k kilograms So weight of fallen rocks should be at least k + 1 |
| To admins: there is an error in test cases | ivzh | 1280. Topological Sorting | 13 May 2020 22:45 | 1 |
Hi! Could you please check the next test case: ``` 3 2 1 2 1 3 3 1 2 ``` result should be `no`, but 4 my case i have `yes`. Despite this i had AC. Thanks in advance! Edited by author 13.05.2020 22:47 Edited by author 13.05.2020 22:47 |
| Hint if you have TL on big tests (# >= 15) | PrankMaN | 1244. Gentlemen | 13 May 2020 21:00 | 1 |
Instead of searching for answer for m, search for sum - m |
| WA 29 test | momo | 1830. Help in the RNOS | 13 May 2020 15:22 | 4 |
Does anybody know what is so special about test no 29? I am positive that my solution is correct (which is obviously not the case) but it gets WA 29. I even compared it with a slow solution (BFS) but I did not find any differences. Please, I would really appreciate some help because I have tested all possible input combination for length 8 and the slow and fast solution produce the same answers. I FOUND MY MISTAKE :) Edited by author 17.06.2011 19:06 Edited by author 17.06.2011 19:06 test: 50 0000000000000000000000000000000000000000000000000000000000001 - 50 times 0000000000000000000000000000000000000000000000000000000000000 ans=2^50-1 : __int64 test: 50 0000000000000000000000000000000000000000000000000000000000001 - 50 times 0000000000000000000000000000000000000000000000000000000000000 ans=2^50-1 : __int64 Well, the length of the strings you provided are not 50 but 61, so the answer for this test is (2^61)-1 The correct test is 50 00000000000000000000000000000000000000000000000001 00000000000000000000000000000000000000000000000000 |
| hint | ajay jadhav | 2034. Caravans | 11 May 2020 23:21 | 1 |
hint ajay jadhav 11 May 2020 23:21 robbers dont know the path, so at each point take farthest node from robbers.do these fo for the length of shortest path and in the end take minimum of these. |
| for WA#5 | ajay jadhav | 1890. Money out of Thin Air | 10 May 2020 23:51 | 1 |
for lazy node propagation I did tree[n]+=(end-start+1)*lazy[n]; when start and end were integers. tree[n]+=(end-start+1)*(1ll)*lazy[n]; corrected error. |
| Is task solvable in python? | Anatoly [sesc 17] | 2102. Michael and Cryptography | 10 May 2020 06:26 | 4 |
I was able to reach 28 test in Python 3. Я дошел до 28 теста на Python 3. Edited by author 24.11.2016 23:52 Yes, I solved this problem using Python Yes, you just have to do some optimizations |
| stop asking #3 WA - HINT here | melkiy | 1603. Erudite | 10 May 2020 04:24 | 8 |
To all of you who cannot overcome #3 !!! All the suggestions about redundant '\n' and about that the dictionary may have repeated words have nothing to do with WA #3 (read condition carefully). If you use any kind of backward tracking, be it recursion or DFS, check the "no luck" condition attentively. First i used checking the next letter to be '\0' at the beginning of my recursion function, and if so returned 'true'. This is wrong! You must make word-end check BEFORE you make the next step, otherwise you may get "deadlock" "there is no direction to go" though there is no need to go anymore!!! Test word for the example table rabadaabracabrac: YES (starting from [3,1] in C-like indices). How did you get rabadaabracabrac: YES In the condition there is said,that words could not have self-intersections. But if you don't intersect you will not get this word. My program writes NO on this test Thank you, melkiy! I made the same mistake :( My program got YES on this test, by have WA#3 It's not a test case for WA#3: rabadaabracabrac: YES and it's not working. My reason for WA #3 was that I tried to use 1d char array to store the table and used i -> i - 1 to go left and i -> i + 1 to go right, however, if you are in the first column you can't go left and if you're on the 4th row you can't go right |
| DP+BIT | ajay jadhav | 1523. K-inversions | 9 May 2020 21:55 | 1 |
DP+BIT ajay jadhav 9 May 2020 21:55 similar to strictly increasing subsequnce of length k just query and update BIT in reverse. |
| different c++ implementations - completely different results | imaginary friend | 1915. Titan Ruins: Reconstruction of Bygones | 9 May 2020 10:45 | 2 |
Clang++ 4.0.1 - 0.39s - Accepted G++ 7.1 - 0.421 - Accepted Visual C++ 2017 - 1.029 - Time limit exceeded rofl in general i noticed that for the most problems clang is usually faster then g++ or ms c++ Edited by author 21.08.2018 03:53 I got it the other way - TLE #42 using G++ and Clang++, but AC 0.687 Visual C++ |
| WA3 and WA12 | Levon Oganesyan | 1651. Shortest Subchain | 8 May 2020 21:50 | 3 |
For WA3 try this: 3 1 2 1 Ans: 1 For WA12 try this: 5 1 2 3 1 5 Ans: 1 5 We have correct answers but on test 7 we have wrong answer Edited by author 08.05.2020 21:50 |
| My mistake for WA #6 | ajay jadhav | 1930. Ivan's Car | 8 May 2020 20:33 | 1 |
I had maintained dis[n+1][2] for distance. But visited array was vis[n+1], changed it to vis[n+1][2] and simple bfs. |
| WA 9 help please | Ivan | 1139. City Blocks | 8 May 2020 18:17 | 1 |
|
| give some tests | {AESC MSU}Vadim Kaushanskiy | 1628. White Streaks | 8 May 2020 10:58 | 4 |
Input #1: 1 1 0 Output #1: 1 Input #2: 1 1 1 1 1 Output #2: 0 Input #3: 30000 1 0 Output #3: 1 Input #4: 30000 30000 0 Output #4: 60000 Input #5: 3 3 1 2 2 Output #5: 4 Input #6: 3 3 4 1 2 2 1 2 3 3 2 Output #6: 5 Input #7: 3 3 2 2 1 2 2 Output #7: 3 Input #4: 30000 30000 0 Output #4: 60000 why? I think the answer should be 2 |
| Test | insi | 1756. One and a Half Diggers | 7 May 2020 22:35 | 11 |
Test insi 13 Mar 2010 14:44 I have WA #2 .. Can somebody give me some tests, please ?:) Edited by author 13.03.2010 14:57 5 2 3 Ans: 3 3 4 5 6 4 Ans: 7 7 8 8 My program: 5 2 3 -> 1 1 8 5 6 4 -> 1 1 1 27 Are these answers correct ? find less diggers solution insi your answers are not correct. You need to keep an even distribution. Edited by author 27.09.2014 11:20 Edited by author 27.09.2014 11:21 Re: Test Yashar Abbasov 13 Apr 2010 02:03 for test 5 6 4 is answer 7 7 7 9 correct? Edited by author 13.04.2010 02:05 Edited by author 13.04.2010 02:05 Re: Test dAFTc0d3r [Yaroslavl SU] 13 Apr 2010 22:23 No. 8 8 7 7 id correct. Because max(7,7,7,9) = 9 > 8 = max(8,8,7,7) and we need to minimize that max. Also acceptable answer: 8 8 8 6 |