Was solving this Cses problem from graph section.I came up with a dp approach for this but getting wrong answer on three testcases.Can anyone help me in where i am going wrong. Here is my submission
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3821 |
3 | Benq | 3736 |
4 | Radewoosh | 3631 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3388 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
Was solving this Cses problem from graph section.I came up with a dp approach for this but getting wrong answer on three testcases.Can anyone help me in where i am going wrong. Here is my submission
my solution 210657479 passes by using a bitset but will give a tle if i use vector...cant figure out the time complexity of reset function
The problem is not monster itself but problem name is....Can anyone tell me why i am getting tle...i am not able to figure out the time complexity of my solution.207893184
Can anyone help me with my last submission. Approach-> 1)Lets take any two strings(say s1 and s2). 2)Now create a string ans from s1 and s2 by taking first character from s1 and then s2 and then repeat. At last we have size of our string ans=4*n. 3)Now i will pair the consecutive same number in the ans string. 4)Now if size of ans is less than or equal to 3*n then it will be my ans otherwise i will create my ans string from s2 and s3,then check for it and lastly check for s1 and s3. Note-> A number can only be paired once. Thanks in advance
Name |
---|