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

Автор KAN, 7 лет назад, перевод, По-русски

Всем привет!

Codeforces Round 398 (Div. 2) состоится в субботу, 18 февраля 2017 в 12:05 МСК для участников из второго дивизиона.

Раунд основан на XIII Нижегородской олимпиаде школьников по информатике им. В. Д. Лелюха, которая пройдет в субботу в Нижнем Новгороде. Однако, комплект задач в раунде не полностью совпадает с комплектом задач на олимпиаде.

Над задачами работали KAP, ashmelev, ZhNV, kuzmichev_dima, mmatrosov, mike_live, arsor и я.

Вам будет дано два часа на решение пяти задач. Как всегда, участники из первого дивизиона могут посоревноваться вне конкурса.

Разбалловка: 500-1250-1500-2000-2500.

UPD: Контест окончен, спасибо всем, кто принял участие! Поздравляю победителей:

Div. 2:

  1. lucyanna2018
  2. Imperishable-Shooting
  3. aduiduidui
  4. Cth1999
  5. mister_dudec
  6. FallDream
  7. Illidan
  8. Alex342
  9. A.Magdy7 и TmEnd

Div. 1:

  1. eddy1021
  2. HellKitsune
  3. I_love_Tanya_Romanova
  4. vintage_Vlad_Makeev
  5. latte0119

Приношу свои извинения, мы рассчитывали, что задача B поддастся большему числу участников. Надеюсь, вам понравились задачи! Разбор будет опубликован после завершения олимпиады, примерно через полтора часа. Разбор.

Нам известно о проблеме с рейтингом. Он будет пересчитан правильно.

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

»
7 лет назад, # |
  Проголосовать: нравится +730 Проголосовать: не нравится

»
7 лет назад, # |
  Проголосовать: нравится +156 Проголосовать: не нравится

Do not thank MikeMirzayanov? DANGEROUS!!!

»
7 лет назад, # |
  Проголосовать: нравится -42 Проголосовать: не нравится

** ** *****?

»
7 лет назад, # |
  Проголосовать: нравится -35 Проголосовать: не нравится

Wait, correct me if I'm wrong (not likely haha) but if someone has a friend who participated in the XIII Nizhny Novgorod Olympiad then he could technically get some advice from him regarding the problems... Are there any countermeasure for that or should we all try befriend some novgorodians?

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

    "The round is based on XIII Nizhny Novgorod Olympiad in Informatics for high school students named after V. D. Lelyukh, which will take place on Saturday in Nizhny Novgorod."

    I assume these rounds will run almost simultaneously.

»
7 лет назад, # |
  Проголосовать: нравится +73 Проголосовать: не нравится

That feeling when you open "Contests" tab and there's this

»
7 лет назад, # |
  Проголосовать: нравится -23 Проголосовать: не нравится

SOORY,BUT THIS CONTEST MAY BE UNRATED BECAUSE CF SEEMS NOT SO WELL

»
7 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

That moment when it's holiday but you have to wake up early to participate the contest :(

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

Wish the problems to be very Interesting! ^_^

»
7 лет назад, # |
  Проголосовать: нравится -16 Проголосовать: не нравится

i hope every one have good contest and i hope the problems be interesting and have many ideas.

»
7 лет назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

I cannot register to the round, could somebody explain why ? thanks

»
7 лет назад, # |
  Проголосовать: нравится +23 Проголосовать: не нравится

The most creative(in aspect of the difficulty) contest ever, and in my humble opinion, no other contests will beat this dishonorable record :D

»
7 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Love the change in friends standings page! :)

»
7 лет назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

Nice and tiny questions You can solve them with push and shove

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

What sort of contest is this. I couldn't do any. #Senseless

»
7 лет назад, # |
Rev. 3   Проголосовать: нравится +44 Проголосовать: не нравится

Why I can see the questions of other participants?

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

    The most ridiculous question is "give me 5 test case" :D And he got answer

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

    At least I finally understand how frequent the admins received messages during a single contest. And I know why they sometimes respond slow. (I hope the high frequency of messages in this contest is not related to the unclear English statments)

»
7 лет назад, # |
  Проголосовать: нравится -18 Проголосовать: не нравится

One of the best problem sets in a while. Keep it up guys!

»
7 лет назад, # |
  Проголосовать: нравится +24 Проголосовать: не нравится

I do think the legends of the problems are toooooooooooo long to read. Maybe shorter legends and clearer problems instead?

»
7 лет назад, # |
  Проголосовать: нравится +151 Проголосовать: не нравится

Hardest Div2 B I've ever seen

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

какой олимпиаде относиться эти задачи? (областной или какой?)

»
7 лет назад, # |
  Проголосовать: нравится +63 Проголосовать: не нравится

scoring distribution should be 750-2000-2000-2000-2500

»
7 лет назад, # |
  Проголосовать: нравится +21 Проголосовать: не нравится

Rating prediction for this contest could be found here or there.

Extensions:

As you could see unfortunately, it is bit difficult for my service to handle such amount of request. I'm sorry for that again, hope mirror solve this problem.

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

    RIP RATINGS

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

    The link isn't working. The page opens and shows some error HTTP Status 500 — An exception occurred processing JSP page /roundResults.jsp at line 15

    type Exception report

    message An exception occurred processing JSP page /roundResults.jsp at line 15

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

  • »
    »
    7 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +6 Проголосовать: не нравится

    This time the results were lot different. This shows -22 negative rating change whereas i almost got exact positive rating change.

    Edit: It seems something is wrong with cf rating changes...

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

      I hope my service doesn't broke codeforces:) Actually now on your rating graph your place in the contest is 203, but in standings it is 319.

»
7 лет назад, # |
  Проголосовать: нравится +32 Проголосовать: не нравится

Имхо описание формата входных данных по задаче В было более чем непонятным. С каких пор вошло в моду разбивать ограничения на две части, то есть писать сначала "три положительных целых числа", а через пару строчек "Все времена не превосходят 1012 "? Имхо было бы правильнее и понятнее(!) написать просто (1 <  = t, ts, tf <  = 1012).

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

how to solve B

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

    Even reds couldn't solve B :(

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

    At first, you must find such time between ts and tf, when there won't be anyone. The waiting time at this case 0. If there are always someone, then u have to find time among all pre-visiters, which is the smallest ( a waiting time, not arrival time).

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

    that's a popular "WTF so standard easy-peasy problem" among russians :D

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

    Lets try to stand in front of every person p in the queue — optimally, we need to come 1 minute earlier than p. Find the minimum of that waiting times (and don't forget to check will it be enough time to become documents)

    Before printing the answer check what if we will come after all persons — will it be enough time (t) to become documents

    Complexity O(n)

    Sry for bad english)

»
7 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Someone Please tell Me What the hell was pretest 4 of div2B ?? Any ideas anyone. Wasted the entire contest reading the question and finding bugs on the same.

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

    Initially I assumed that the starting time can be any time < e. But I got 5 WAs on pretest 4, lol. When I changed it to start_time < e-t, then I passed that case.

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

      The problem statement clearly states "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)." Your answer indicates that the receptionist ALSO STOPS SERVING THE ONE HE IS SERVING. Did I get that right?

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

        Yes, I got confused by that line as well. :(

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

          Exactly if start_time<end-t then it means no visitors can be processed but the output statement states that there always exist an answer. So what should the answer be in such a scenario??

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

            There is probably no such input because "It is also guaranteed that Vasya can arrive at the passport office at such a point of time that he would be served by the receptionist."

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

        Yes it has to be "ALSO STOPS SERVING THE ONE HE IS SERVING.". I also had the same doubt and clarified it early (luckily). I believe problem statements weren't clear on this.

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

          The problem statement is extremely clear on this. In fact, it clarifies that the statement "stops serving visitors" does not relate to currently served visitor. Model solution and tests are simply broken.

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

            No I was wrong, the key part of the statement that I read incorrectly was "If the receptionist would stop working within t minutes". So the statement is concerned with time (end — t), like satyaki3794 said. After that time point the receptionist does not accept new customers, but he will serve the current customer through, and be done with him before end time.

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

        No, obviously not

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

    You can finish exactly in tf. Example: ts = 3, tf = 7, t = 4. It is possible.

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

How to solve A

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

What the Fuck ? It is impossible to solve the 3rd problem in Java if u use adjacency lists.Why >>>? I get MLE for storing the edges. Is this even fair ?

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

Was B binary search? I was trying to binary search between the times of the people in the queue and took the best one out of all the gaps but I couldn't get it to work.

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

    First check if there's a time before tf such that no one is waiting for processing. Then vasya can come at this time, and wait for 0 second.

    If not, and if there are k different arrival times in input, then try to see if there's a minimum waiting time possible for the preceding time for all these k values. Additionally, check the time after all values in input are processed, if then vasya can still get his request processed, before tf.

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

      Thanks! That makes a lot of sense actually.

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

        Can't access your code. You can check my submission. I wrote comments for everything.

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

          Can you link your submission?

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

    Just check Ai, Ai - 1, ts, and after all people. (Ai is arrival time of i)

»
7 лет назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

lucky I skipped the 2nd one for last

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

Please, someone explain E to me. I think I reduced it to knapsack but with big dimensions.

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

    You don't need to do knapsack. You always choose one of these per day: paying with notes only OR paying exactly. And "paying with notes only" can be thought that you get 100 coins and some dissatisfaction. So greedy will work. Simulate from beginning. Whenever you don't have enough coins, choose a day with minimum dissatisfaction from the past and add it to the answer. Priority queue will be enough to implement this.

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

I guess time limit for D is too strict, my Nlog(10^7) + Mlog(10^7) didn't pass.

Plz have a look and tell me if I am missing something: http://ideone.com/Tdob4l

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

    I think their intended solution is with time complexity O(n + m + 107). And I passed pretest with this time complexity.

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

      But shouldn't my solution pass too as it is well within 10^8 compuations?

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

        I think using set is with big constant on each operation like insert and upper_bound, which leads your solution TLE.

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

          I guess all operations of set takes log( set.size() ) time which I computed earlier, and then too I don't find a way where computation increase to 10^8.

          Can you plz tell when we should avoid set( as u say it causes TLE ) and use some other option as I usually see 10^8 compution( if exceeding then TLE )?

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

            Ummm... Just to understand using functions from STL may requires higher time as they are usually with larger constanst.

            For instance, writing binary search on your own is usually faster than using lower_bound from STL. Also, maintaining stacks or queues on your own are usually faster than using queue<> and stack<> from STL as well.

            You may try to have some experiments on performing million times of binary search written by yourself, and with the same case, test on performing million lower_bound.

            In cases that we can easily write functions on our own, and the problem TL is very tight, we should not rely on STL functions.

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

          Can you tell me how to pass memory limit? I used up to 262000 kb and cannot pass the test zz

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

        It is not well within 10^8 operations. If any of the cartons has size 10^7 then variable maa is also equal to 10^7.
        Before you begin calculating the answer you insert all integers from 0 up to maa into your set and this initialization itself takes around 2*10^8 operations.

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

          10^7 * ( log(10^7) ) == 7 * log( 10^7 ) ( Base 10 )

          10^7 * ( log(10^7) ) is approx 2 * 10^8 ( Base e )

          Are STL operations base 10 or base e as both gives different results?

          Yeah I realised that earlier from comments above and made it AC after changing variable maa threshold.

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

            I think the most of the time we deal with base 2 logarithms. Nobody bothers to mention the base unless its different from 2 (Correct me if im wrong). Since sets are usually implemented as red-black trees (according to cpp reference) i believe the base is equal to 2.

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

      I passed pretests in O((n+m)logM), but it was a tough battle.

      Input/Output took the most of time. TL was too strict imo.

    • »
      »
      »
      7 лет назад, # ^ |
      Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

      My solution passed pretest easily

      UPD And it passed all tests in around ~1 sec

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

    Strange, my solution which is O(Xlog(N)) passed, where X = 1e7

    http://codeforces.com/contest/767/submission/24774891

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

      Maybe judge data was weak.. I don't see any number fi, si being 107 in the tests. I can see that there are maximum fi, si ≤ 9 × 105 :| Then O(xlogn) passes simply.

      Also even if x = 1e7 then it can pass also :) O(1e7 log 1e7) O(2 * 1e8)

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

      Lucky you optimizing I/O operations... cannot do this in C#... :P

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

    Yeah, time limit in D was too strict.
    Submited using :
    Binary Search and Sorting : TLE on test 8 24776219
    Binary Search and Two Pointer with cin/cout : TLE on test 9 24776253
    used scanf/printf : AC 24775689

»
7 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Hard Problem set, but atleast now I learn how to use set :)

»
7 лет назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

When you find out your solution to B is wrong 1 minute before the contest ended... :(

I have a feeling many B solutions will fail system testing...

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

Nice problemset. A-C were awesomem very good tasks

»
7 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

B is hardest than D

Logic R.I.P

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

Maybe it should be Div1 contest istead of Div2 ? :)

»
7 лет назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

Guys! English!!

What the heck with problem C. I understood the problem from context, not from the description. Please don't use translators, ask someone who speaks English well to translate statements.

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

    I understood it from the picture :D :D Yeah, the statements suck a lot.

  • »
    »
    7 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +17 Проголосовать: не нравится

    This sentence in problem D : "The main issue Olya has is the one of buying new cartons."

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

      RIP...English.

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

      This sentence in problem B : "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)."

      I got 1 wrong answer before I realized, the receptionist leaves exactly at tf, even if somebody's request is partially completed.

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

Was problem C greedy tree dp? My approach was to find a subtree of weight of dp[root]/3 and remove the weight of that subtree from its ancestors' weights. Then I try to find another subtree that has weight of dp[root]/3 and we are done.

Code: Link

Is this approach correct?

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

How to solve C? I am getting WA on pretest 8 and 10.

My approach -> If totalheat is not divisible by 3 return -1. Check if we can find two subtree of totalheat/3 then return those 2 values. Check if we can find a subtree with heat totalheat/3 and and it's parent with heat 2*totalheat/3 then return parent and that node. Else return -1.

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

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

    The general idea is correct but your solution fails at both cases. You need to check that two subtrees of weight totalheat / 3 do not intersect and checking that immediate parent has weight 2 * totalheat / 3 is not enough — it could be parent's parent that has the weight 2 * totalheat / 3.

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

    While calculating weight of subtrees, whenever weight of a subtree equals totalheat/3 push it into ans vector and return 0, because it will not be contributing in it's parent. It will handle the removal of that subtree.
    24775716

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

The problem-set was nice, but I feel that the difficulty levels of the questions was jumbled up. I found A<D<=C<B<E, in order of increasing difficulty.

RIP Rating

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

Can someone tell me why printing 16 gets WA on problem B pretest 2? I think I miss something in the statement but it says: "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)."

»
7 лет назад, # |
  Проголосовать: нравится +48 Проголосовать: не нравится

Now you know why there are 8 writers: we need people to draw the cartoon and to write stories. :P

»
7 лет назад, # |
  Проголосовать: нравится +88 Проголосовать: не нравится

398 (Div.2̶ 1)

»
7 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

i am not sure if this was a div2 round or div1 round sorry to say that but it was one of the worst rounds i have ever seen here

»
7 лет назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

good contest for DIV I contestants, Div II contestants RIP

»
7 лет назад, # |
  Проголосовать: нравится +99 Проголосовать: не нравится

My first DIV1 contest.

»
7 лет назад, # |
  Проголосовать: нравится -19 Проголосовать: не нравится

C was awesome...D was a little easy for a D problem (they should have been swapped)

I didn't read B but judging of the number of people who have solved it it must be really hard for a B problem

The statements were rubbish..they were way longer than they needed to be (that's why I didn't solve B...skipped it after seeing the statements)

But all in all the contest was great.

(don't downvote me guys it's just my opinion)

:)

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

    it was great because you didn't read problem B

    but who read problem B and tried to solve wasted too much time while problem D was easier to solve

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

It so frustrating when you solve problem but can't pass tests because standard reading method, you used all the time, doesn't read fast enough for this input. I have linear time solution for C but probably reading method I use in my C# solution too slow. Now I think that string.Split() is just too slow for this problem. Don't enjoy such contests.

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

    I have the same I/O timeout problem for problem D also for C#. Spent the entire contest time trying to figure out why I am getting timeout on test 9.

    I also don't welcome this situation. The official answer was that "It is not guaranteed that a solution exists for all languages". Well, c'on... I have seen some folks with solutions in C++ and still getting timeout on test 9, probably for the same reasons (since some are Div1).

    I would like to thanks the organizers for setting up the contest of course, really enjoyable, but cannot but feel disatisified with taking a big rating hit for trying to solve a problem which is unsovable given the time limits without optimizing I/O.

    Really, this is a known issue. My opinion is that the limits should have been increased to 3 or 3.5 seconds to allow for such reads. This will still not make an n^2 fit but will allow enough time to I/O...

    Didn't even have time to read the others except B (which also has a very long text...). My opinion is that weather this particular contest should be rated should come into question.

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

Am I the only one who practice translating hardly?

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

Lowest solved, highest wrong answer :P "long live 398 Div#2"

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

Be stucked in Problem B. RIP my rating. :<

»
7 лет назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

Contest should be unrated.

Bad translations, long statements and very hard B.

»
7 лет назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

Olympiad Student 1 pass : olympiadolympiad

»
7 лет назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

is it rated?!

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

    only for Div.1 participants ;)

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

      No please:) I just resubmit without thinking when i stuck at some problems. Many pretests failed including failing pretest 2 :)

»
7 лет назад, # |
  Проголосовать: нравится -23 Проголосовать: не нравится

Vote here. They can make contest unrated.

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

    I liked the problems. They were harder than usual, but they were harder for everybody, not just you. Why make it unrated?

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

      I would vote for unrated because there were several issues with timeouts due to I/O operations taking to long (for example in C# for problems D and I understand also C).

      I would really have enjoyed this contest especially due to the harder problems however if despite a sound solution I have to spend the entire contest time to figure out I get timeouts due to I/O, then.. I would go for unrated.

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

    do not worry, your name will fit your new rank haha

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

Fastest Systest ever... no wonder, since there was so low total number of submissions.

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

How to solve E?

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

4 6 2

0 1 1 1

2 2 2 2 2 2

Are cases like these not in system tests? At least two of my friends will output -1 for this test but I believe all the cartons of milk can be drank, right?

In fact, my friend will fail if there is no 0 in the first line but a solution still exist. This apparently is not in the systests however ==

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

    Shouldn't the answer be -1? We can drink carton 1 and 2 that are inside fridge on day 1 but how can we drink carton 3 and 4 on day 2?

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

A. Pretest 5 should be a systest! There should be more possibilities to hack.

»
7 лет назад, # |
Rev. 3   Проголосовать: нравится +5 Проголосовать: не нравится

problem B test case 3 :

input:

7 14 3

2

1 2

output:

13

answer:

0

statement says :

The receptionist spends exactly t minutes on each person in the queue. If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves).

my output should be correct

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

    Yes I have the same question too for my submission. Please someone to answer us.

  • »
    »
    7 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

    Your output is 13, while if Vasya visit t = 13, the receptionist would not serve Vasya as the reception cannot close before tf = 14 because it requires 3 minutes serving Vasya (from t = 13 to t = 15).

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

      Yea but the statement says "(other than the one he already serves)."

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

        Which means someone he is already serving, and not people who are in the queue waiting.

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

        I think the receptionist will choose to serve a new comer or not, based on whether if the receptionist can serve the new comer fully before the close of reception

        So for "the one he already serves", they mean those being fully served as the receptionist will choose not to serve the new comer if the new comer cannot be fully served.

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

        Yeah, but the statement also says "(so that (tf - 1) is the last minute when the receptionist is still working)". So (I'm also not happy to admit), from the statement, the answer to case 3 is indeed 0. Dammit!

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

    same problem here i was stuck with that test case

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

    Let's rephrase the last sentence : "The receptionist will not accept new customers during last t minutes, but she will finish serving those who came until time t_f - t" I misunderstood this statement during contest as well, but fixed my code easily with this new insight (compare 24774069 and 24775470).

    IMO, pretest 3 should have simply been added to problem statement and all would be much better.

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

      I see. Thanks for the answer. Personally I am not so good in english and I find the translation terrible. I suppose that many others feel the same and that this bad translation costed to us time and rating.

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

    I faced the same problem

    this system test is the worst of all

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

    My solution failed system tests just because of this 'error' in the problem statement. Maybe this is one of the reasons why B had so many successful submissions.

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

      KAN MikeMirzayanov Could you please provide some clarification as to what that statement meant? Some other used asked during the contest and he was clarified what it meant. Should not that have been an announcement for everyone?

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

        As others mentioned, the statement is: "When there is t minutes before tf, the receptionist stops serving new visitors, and only finishes serving the one which is already being served."

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

          Unfortunately, I do not see that line in problem statement. All I see is "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)." And I do not think many people would agree that both the statements mean the same thing.

          The problem statement should have been more clear :)

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

    This part of the statement explains why the answer to case 3 is 0:

    "(so that (tf  -  1) is the last minute when the receptionist is still working)"

»
7 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

System test gives WA for all submission for problems D &E

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

WTF is wrong here, it says my D is accepted but in standings it seems like it failed — http://store.picbg.net/pubpic/6A/71/96070172827f6a71.png?

UPD: That's the case for everyone, now I see...

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

I do not know why everyone says that problem B was difficult, it was just a simulation and greedy, for me it was more difficult to solve problem C

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

This was the worst contest for me — I began with C, did it. Then tried D, but failed on some pretest. At this point I had just 20 minutes left, so I went back to A and B. I got A, but with a very low score, then wrote B. I had a small bug, which I found. I was just about to click submit when the contest ended(I had already selected the file). In the end, my C fails system test. :(((

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

I've got a question. This is test 4 for B problem:

30 70 10

3

30 32 35

Why is the answer 60? Isn't the queue supposed to close a tr — 1 = 69?

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

    If Vasya visits at t = 60, Vasya is served from t = 60 to t = 69 which consists of 10 whole minutes. So the reception can close at tf = 70.

    so that (tf - 1) is the last minute when the receptionist is still working

    By this, the receptionist still works at t = tf - 1 = 70 - 1 = 69.

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

What's going on with the standing? They are giving fail in spite of passing? NVM, it got fixed

»
7 лет назад, # |
  Проголосовать: нравится -40 Проголосовать: не нравится

What kind of time limit has been set for the 2nd problem ?

What fool did it ? Who is this foolish person who set this problem ?

Submissions :

  1. Java (During the contest), MLE : http://codeforces.com/contest/767/submission/24771836

  2. C++ (After the contest), AC within 1310 ms : http://codeforces.com/contest/767/submission/24775207

Such a negligent attitude is rather bad, and I dont think deserves a place on CF. The two codes are 150 % identical, expect they differ only and only in language .

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

    Dude think before calling the problem setters foolish. They are doing this voluntarily and you should be thankful to them instead. Sometimes there are some negligences, but you shouldn't call them foolish at least.

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

Is this proper test for B? Is only Vasya can come at midnight (at time 0) ? 0 7 2 4 0 0 0 6

»
7 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

Каждого оставившего коммент к этому посту мистер дудец благословит сильными претестами и понятными условиями, но только если вы напишите "спасибо мистер дудец".

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

I was deceived by the unusual input of C which is tree data

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

In problem B, for the 3rd pretest:

7 14 3
2
1 2

My answer was 13. Why is it wrong? In the condition it states: If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves), so I assumed that means he should enter before tf but doesn't need to get out before tf. Either I'm missing something or the condition was wrong.

Whoops, someone already posted the same question, sry.

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

    same problem here

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

    MikeMirzayanov please look into this

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

    If you go at time 13, the receptionist would stop working within 3 minutes(actually after 1 minute the person will stop working). So you can't get served.

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

      (other than the one he already serves), this means that he keeps serving the one she already servers.

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

        No, that means, say, assume you go at time 9 and start served. At time 11 the receptionist would stop working within 3 minutes, but the server continues to serve you.

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

        I think the receptionist will choose to serve a new comer or not, based on whether if the receptionist can serve the new comer fully before the close of reception.

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

    You won't be served if you come at 13, because the queue closes T seconds before the end.

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

      (other than the one he already serves), this means that he keeps serving the one she already servers.

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

        But he comes after than T seconds before the end, so the queue is already closed. He isn't even start getting the passport.

        The idea behind the phrase is the following one. Suppose T = 5, Tr = 20. If you come at 13 seconds, you will be served even if the queue is supposed to close at 15. If you come at 18, however, you aren't served.

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

    Oh yeah, I just read that wrong, my bad, missed the "within t minutes" part. I should buy new glasses xd.

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

In problem B This test case: 7 14 3 2 1 2

The output of the judge is 0 however i am printing 13 and he tells me wrong why he can come at min. 13 noone is there so he can enter as the 2nd one finishes at min. 13

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

Что-то явно пошло не так, но чтоб 0 решений на Д и Е... Это было сильно.

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

    Оно почему то не отображается, нажми на попытку просто любого у кого горит красный минус, и будет написано полное решение. Я бы даже сказал что Д задача была самой лёгкой здесь.

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

 I got 17th place, but it is showing that I got 49th place.

»
7 лет назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

That moment when only A is accepted but I have new best rating lol.

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

MikeMirzayanov Rating change is weird.

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

Why does it say I am in position 656 or so if I'm in position 97? My rating went down when it should have gone up. Please help

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

Why is everyone's D on the scoreboard wrong?In status I see I have accepted it.But the rating have changed according to the scoreboard .

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

MikeMirzayanov how come the same test case pass in the pre-test and fail in the system test, my solution is anyways has a bug but I'm just curious.
http://codeforces.com/contest/767/submission/24762072

»
7 лет назад, # |
  Проголосовать: нравится +43 Проголосовать: не нравится

Cheaters On Problem D:
Hasan: Submission
M.A.H.M.O.O.D: Submission

»
7 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

hi .. there is a problem in standing now .. my soultion for D is accepted and apper on my standing -1 !! and i haven't points and my rate is decrease !! how !!??

»
7 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

on the contest standings it says that I ranked 103(without unofficial participates) but on my profile it shows that the last contest I did (#398) I ranked 289

Can somebody look into this because it will effect my rate a lot ?

»
7 лет назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится

Seems the problem with D&E standings display also affected the rating changes... Is there anyone fixing this?

»
7 лет назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

Ahhhhhh,What's the matter? I think my rating is too high.

»
7 лет назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

my submission of problem D showed accepted in "My submission",while the final score is calculated without the score of problem D. what is the problem?

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

Question C: That moment when you realize that abs(1/3 * total) < abs(total) doesn't hold if total = 0.

EDIT: total -> abs(total)

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

When you solved 1 problem but your rating still increases

»
7 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

I want to know why my rating -48,In this conteset my rank is 124, but the profile's rank is 980,why ? Sorry,my English isn't well

»
7 лет назад, # |
  Проголосовать: нравится +60 Проголосовать: не нравится

this happened because you didn't say thanks to MikeMirzayanov

»
7 лет назад, # |
  Проголосовать: нравится +31 Проголосовать: не нравится

Strange rating change. It seems like problem D is not considered.

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

странн, в результатах у меня 156-ое место. А тут написано 447

»
7 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Problem B statement is wrong.
"If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)."
I submitted without considering above statement, my solution got accepted.

»
7 лет назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится
More points but less rating increase
»
7 лет назад, # |
Rev. 2   Проголосовать: нравится -38 Проголосовать: не нравится

.

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

    The contest is already unrated for you!

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

    Which test is not correct? Easy to say sth. like this without mentioning a specific test

    • »
      »
      »
      7 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится
      7 14 3
      2
      1 2
      Answer should be 13 instead of 0.
      Problem is occuring because of wrong problem statement.
      "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)."
      
      • »
        »
        »
        »
        7 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        even i had that confusion and had 4 WAs thanks to that. then i asked in the question section and got clarified.

        As codeforces's popularity is growing day by day, I think they should take an effort to provide better English statements.

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

          Either round should be unrated or submissions must be retested based on the problem statement.

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

            If it gets retested, a lot of AC ones will get WA.

            I don't think this happened for the first time in CF. It happened a lot in the past too and none of those round was declared unrated...

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

        I fail to understand why it should be 13? If you arrive at 13, you won't be served, because t_f is 14 and 13+3 is > 14?? This complies with the problem statement.

        • »
          »
          »
          »
          »
          7 лет назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится
          "If the receptionist would stop working within t minutes, he stops serving visitors (other than the one he already serves)."
          This implies that even if you arrive at 13 you will be served.
          
»
7 лет назад, # |
Rev. 2   Проголосовать: нравится +32 Проголосовать: не нравится

Please, next time spend your energy on writing more clear problem statements instead of drawing pictures to all questions.

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

well, feel lucky not to compete in this round- - seems easy but actually…er…you all know now.

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

    after read the problems carefully…regret? D & E seems extraordinarily easy……than B

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

How is the rating calculated? I ranked 21st in the contest,but the rating dropped by 20! I'm the only one whose rating dropped among the top 88 people,including those whose ratings were initially higher or lower than me.In particular,there are many people whose initial ratings were higher than me,scored lower than me in this contest,but their ratings rose sharply!How could this happen?

»
7 лет назад, # |
  Проголосовать: нравится +65 Проголосовать: не нравится

We know about the issue with ratings, they will be rolled back and then updated properly. Don't worry.

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

In pC, when I hacked others with 4 0 1 1 -1 2 1 3 -1 The verdict of the hack is an unexpected error...... Just wonder whether this kind of testdata are already in the system test or not...

»
7 лет назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

 Why rating changes is not logical ....

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

why? same original rating , higher rank,lower rating? feel sad QAQ!

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

LOLImage and video hosting by TinyPic

»
7 лет назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

The problems D&E were even not considered in standings on my IE ,but fortunately now it has been fixed .Just waiting for the fixing of rating changes now .

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

Вроде задачи, как на Олимпиаде, но другие ограничения. +Разбор тут, насколько понимаю, раньше разбора в Нижнем Новгороде?

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

Hard but interesting problem set. Thanks for your work and I also appreciate the strong pre-tests!

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

Can someone provide me some good questions for practice on DP on trees.?

»
7 лет назад, # |
  Проголосовать: нравится +22 Проголосовать: не нравится

KAN How this Code get AC ?!
test:

3 1 2
1 1 1
2

Code Output :

-1

Expected Output :

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

I think score distribution should be change

»
7 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

KAN
How can this code http://codeforces.com/contest/767/submission/24788498
24788498 get AC test case
5 20 4
4
0 0 10 14

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

    This is invalid test The third line contains positive integers in non-decreasing order the time of the visitors must be positive, it can't be 0

»
7 лет назад, # |
  Проголосовать: нравится +23 Проголосовать: не нравится

Wow! I got three 98 in Codeforces Round #398!

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

i think the problem is good , not only degree of difficulty , but also the trick . forever , the difficulty classification is so bad , the D is easier than B and C i think A D B C is better than the round .

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

Solution for B: ~~~~~ ~~~~~

long min = 0;
        long mins = ts+t;
        int pl = 0;
        for (; pl<n; pl++) {
            if ((ts+(pl)*t+t<=tf) && (ts+(pl)*t+t-(mas[pl]-1)<mins))
            {
                mins = ts+(pl)*t+t-(mas[pl]-1);
                min = mas[pl]-1;
            }
        }
        System.out.println(min);
So easy...
»
7 лет назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

I wonder why this 24795199 got WA. I need help.

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

I found a test case which is
6
2 -1
3 1
0 1
3 -1
4 1
5 -1
Both my friends passed the problem, but have different output,
their submission are 24775420, 24775421
the first one output 2 5, which I think is correct, and the second one output -1
Do the sys test miss the test case like this?