Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems.
×

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

1 | MiFaFaOvO | 3681 |

2 | tourist | 3669 |

3 | Um_nik | 3535 |

4 | 300iq | 3317 |

5 | ecnerwala | 3294 |

6 | maroonrk | 3268 |

7 | TLE | 3223 |

8 | scott_wu | 3209 |

9 | WZYYN | 3180 |

10 | boboniu | 3174 |

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

1 | Errichto | 198 |

2 | antontrygubO_o | 191 |

3 | pikmike | 185 |

4 | Ashishgup | 182 |

5 | vovuh | 179 |

6 | Um_nik | 177 |

7 | Radewoosh | 174 |

8 | SecondThread | 169 |

9 | Monogon | 163 |

10 | McDic | 162 |

Comments

0
EDIT: I got it. It turns out that in the calculation of g=2, I overcount the pairs that have 4 as a gcd and I count them as having 2 as a gcd... In the ans[4], they are divided by 4 (their gcd), so to remove the overcounting I multiply the ans[4] by 2. |

0
Why do you need to, if for example g=2, to exclude twice the answer of 4? |

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jul/15/2020 22:28:44 (h2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|