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

1 | Um_nik | 3538 |

2 | tourist | 3509 |

3 | Benq | 3473 |

4 | ecnerwala | 3446 |

5 | ksun48 | 3432 |

6 | maroonrk | 3404 |

7 | Radewoosh | 3383 |

8 | yosupo | 3324 |

9 | boboniu | 3300 |

10 | apiadu | 3238 |

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

1 | Errichto | 207 |

2 | Monogon | 199 |

3 | SecondThread | 191 |

4 | vovuh | 188 |

5 | Um_nik | 185 |

5 | antontrygubO_o | 185 |

7 | pikmike | 184 |

8 | Ashishgup | 182 |

9 | pashka | 168 |

10 | Radewoosh | 167 |

what's wrong with my code of 158_DIV2_C? Here is my submission:2847080

My rating is just 1453 but I still wanner write my own tutorial to share with you.

A. 252A - Маленький xor This is a simple problem. We can write a algorithm using brute force. The complexity of it is O(n^3). My code 2713341.

B.252B - Разупорядочивание массива This is a greedy problem. There are several special cases: 1. There is only one or two interger. Answer is "-1". 2. There are three interger and they are placed like "1 2 1" or "2 1 2", whatever you do you will make an sorted array. 3. All the numbers are the same so we can't make any operation. 4. Here are other cases: We find the first unequal pair searching from the head of the array, then we swap them. We will get the unsorted array unless what happen below: The pair are the first two numbers and the second is the max number or the min number. So we just search the unequal pair from the trail and swap them then we will get the right answer.The complexity of it is O(n). My code 2714096

C.251A - Точки на прямой This is a DP problem. We user two pointers and one points to the left most interger and the other points to the right most interger.For every left points we need find out the right most interger, then we just calculate C(r-l+1,2) means we pick up two intergers from the sequences freely. Because the position of the right interger can't decrease so the complexity of it is O(n*2).My code 2704914

These are the problem I solved in the contest. Sorry for my poor English and bad code ability. You may seek the official editorial for more infomation.

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Oct/23/2020 11:43:02 (h2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|