Hi, I am eager to know How to Find the Optimal Strategy When First See a Game Problem?

For example, CodeTON #2 Problem F Colouring Game, how do you know "start by taking RB/BR parts" is the smartest move, before you see the editorial?

# | User | Rating |
---|---|---|

1 | tourist | 3751 |

2 | Benq | 3727 |

3 | cnnfls_csy | 3691 |

4 | Radewoosh | 3651 |

5 | jiangly | 3632 |

6 | orzdevinwang | 3559 |

7 | -0.5 | 3545 |

8 | inaFSTream | 3478 |

9 | fantasy | 3468 |

10 | Rebelz | 3415 |

# | User | Contrib. |
---|---|---|

1 | adamant | 178 |

2 | awoo | 167 |

3 | BledDest | 165 |

4 | Um_nik | 164 |

5 | maroonrk | 163 |

6 | SecondThread | 160 |

7 | nor | 158 |

8 | -is-this-fft- | 154 |

9 | kostka | 146 |

10 | TheScrasse | 144 |

Hi, I am eager to know How to Find the Optimal Strategy When First See a Game Problem?

For example, CodeTON #2 Problem F Colouring Game, how do you know "start by taking RB/BR parts" is the smartest move, before you see the editorial?

Hello everyone! After endless debugging, I finally got AC on all the samples and submitted my code of F — Bear and Chemistry. However, it got **Wrong Answer on test #63**(which is not a hack, but a big case with `n=300000,m=300000,q=100000`

!), and there are 77 testcases in all(which means I have passed a major part of them)!

I am pretty exhausted now. I wonder if any one of you experienced programmers can **share with your approach in tackling this kind of thing**. I would be most grateful!

Note: Don't get me wrong, I was not asking for you to debug my code.

Hi CF users. Me is needing help with CF1530F Bingo.

In fact, my solution is able to pass the first two samples, but WAs on the third where $$$n\ge 3$$$.

Yet I am not able to find a mistake in my method, which is narrated as follows:

- Consider two cases: there is a row all-1 and there isn't one.
- For the 1st case: brute force the mask of the all-1 rows, and calculate the Product possibility of all selected nodes.
- For the 2nd case: Consider diagonals as columns; so there are $$$n+2$$$ columns. Dfs the mask of the all-1 columns, so for each row i we are able to calculate the $$$Product$$$ of $$$p[i][j]$$$ for those $$$(i,j)$$$ that are undetermined; the product of all $$$(1-Product)$$$ should be the possibility of "at least a column is all-1 and no row is all-1".

This is my code. Will you help me?

As known, there is a "smart_indent" option in Sublime Text. However I have recently found this intent option un-smart when I wanted to change the style of indentation.

E.g., when I type a

```
for(int i=1;i<=n;i++)
cin>>a[i];
```

I'd prefer

```
for(int i=1;i<=n;i++)cin>>a[i];
```

But the "smart_indent" option would do this↓ when I change into my preference of the sentence:

```
for(int i=1;i<=n;i++)cin>>a[i];
int x;
```

I mean it would still insert a tab when I press "Enter". Worse yet, if I backspaced that tab and finish the second line and press enter again, the third line would backspace a tab automatically.

That's really annoying isn't it, so I switched off the smart_indent option, wishing it would no longer produce that tab.

However, things get worse. Nothing would happen when I enter the second line, but a tab would still be backspaced on the third line!

Confused, I came here for advice: What should I do?

My first solved-problem on Codeforces.

It's really an easy problem.

As we know, if you want to make the a and b as small as possible, they must only contain digits 0 and 1.

So, we have the thinking in the following:

- if the digit of x[i] is 2: we try to make a[i] and b[i] both 1.
- if the digit of x[i] is 0: we try to make a[i] and b[i] both 0.
- if the digit of x[i] is 1: either a[i] or b[i] would be 1. We'll make a[i] 1 because it is no difference if we make b[i] 1.

However, if we make a[i] 1, the number a must be larger than b as a fact.

So, we would not want to make array a still bigger. So after we make a[i] 1, we have different thinking:

- if the digit of x[i] is 2: we make a[i] 0 and b[i] 2.
- if the digit of x[i] is 0: we make a[i] and b[i] both 0.
- if the digit of x[i] is 1: we make a[i] 0 and b[i] 1.

That's all. We'll discover that after we make a[i] 1, a does not increase anymore, but b is increasing, however it will never be bigger than a.

Thanks for reading, hope that'll help you!

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/28/2023 14:20:42 (l1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|