Блог пользователя Laggy

Автор Laggy, история, 7 лет назад, По-английски

Hey guys, I am working on a virtual contest picker as part of the algo-chan project. I am trying to use http://mirror.codeforces.com/api/problemset.problems to build a problem list for each contest but this won't work because of contests with more than one division only the appended problems show there.

Example: ContestsL 872,871,870 870 seems like the base for the other two but there's no way to know where the other two start. For 872 the api doesn't even know about it's existence.

I hope MikeMirzayanov or anyone who has experience with doing something like this could help. PS: I am trying to use the API and not parse every codeforces.com/contest/id page. (Keeping this as a last resort)

Thanks in advance.

  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

»
4 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Sorry for bringing this 2 years old blog back to life but I am facing the same issue. Have you found solution for this Laggy?

Please check this MikeMirzayanov and Fefer_Ivan

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I'm about another year late to this, but for anyone who might still have this problem, it seems like you can get the list of problems in a given contest by quering the contest.standings endpoint, which has a result.contest.problems field with all problems. For example, https://mirror.codeforces.com/api/contest.standings?contestId=1529&from=1&count=1.

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      But this doesn't solve this issue. We want to get all problems from all contests in one go. From above endpoint we would need to thousands of queries to get problems from thousands of contests till now. Moreover there a rate limiter, you can't do them in one go.

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Thienu It is responding with only type, name and some other properties of the problems, How can i get the all problems test cases?

      • »
        »
        »
        »
        3 года назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        You can't get all test cases of a problem (by design).

        • »
          »
          »
          »
          »
          3 года назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          Okay, how come then some people parse the test cases of a contest to files into their local system? Do they parse it by fetching HTML pages?

          • »
            »
            »
            »
            »
            »
            3 года назад, # ^ |
              Проголосовать: нравится +10 Проголосовать: не нравится

            IIRC, these extensions parse the the problem statement pages directly to extract the sample cases.