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 | 3947 |

2 | jiangly | 3740 |

3 | Radewoosh | 3652 |

4 | Benq | 3626 |

5 | jqdai0815 | 3620 |

6 | orzdevinwang | 3612 |

7 | ecnerwala | 3587 |

8 | Geothermal | 3569 |

8 | cnnfls_csy | 3569 |

10 | ksun48 | 3485 |

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

1 | awoo | 162 |

2 | maomao90 | 160 |

3 | adamant | 156 |

4 | atcoder_official | 155 |

5 | cry | 152 |

5 | maroonrk | 152 |

7 | nor | 150 |

8 | SecondThread | 148 |

8 | -is-this-fft- | 148 |

10 | Petr | 147 |

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-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/13/2024 14:54:51 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|