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

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

Hi everyone, it's me again!

Codeforces Round #372 (Div. 1 + Div. 2) will take place on 17 September 2016 at 16:35 MSK,

After my last round, this will be my second round on Codeforces. I believe you'll find the problems interesting and I hope you'll enjoy the round.

This round would not be possible without danilka.pro who improved one of the problems that made this round possible, and also helped in preparing and testing the round. Also, thanks to all the testers, IlyaLos, HellKitsune and phobos and thanks to MikeMirzayanov for the awesome Codeforces and Polygon platforms.

ZS the Coder and Chris the Baboon's trip in Udayland is over. In this round, you'll help ZS the Coder solve the problems he have randomly came up with. Do you have what it takes to solve them all?

The problems are sorted by difficulty but as always it's recommended to read all the problems.

We wish you'll have many Accepted solutions and enjoy the problems. :)

As usual, the scoring will be published right before the contest.

UPD : There will be 5 problems in both division as usual.

Scoring :

Div. 2 : 500 — 1000 — 1500 — 2000 — 2500

Div. 1 : 500 — 1000 — 1500 — 25002750

Good luck and I hope you enjoy the problems!

UPD : Contest is over. I hope you enjoyed the contest and problems :) I'm sure some of you wants to see the editorial now, so here it is while we wait for System Test to start.

UPD : System tests is over. Here're the winners :

Division 1 :

  1. EvenImage

  2. matthew99

  3. jerry

  4. Burunduk1

  5. JoeyWheeler

  6. LHiC

  7. SanSiroWaltz

  8. dotorya

  9. Arterm

  10. zeliboba

Division 2 :

  1. amethyst0

  2. JOHNKRAM

  3. huzzah

  4. Vax

  5. KyleChen

  6. LeiQ

  7. Tomer.Adar

  8. creatnx

  9. OrangePlus

  10. Yukikaze

Congratulations to them!

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

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

Auto comment: topic has been updated by zscoder (previous revision, new revision, compare).

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

I like Chris the Baboon...

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

hope that scoring distribution will be announced before the contest ... unlike the previous round

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

Auto comment: topic has been updated by zscoder (previous revision, new revision, compare).

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

last round was absolutely amazing for learning purpose! DP + GRAPHS + MATHS + ADHOC.. hope to see more such rounds in future covering diverse areas with good problems.. :) thank you.. :D

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

Excuse me, this round overlaps with topcoder Google Sponsored SRM. Is there any possibility of changing the time of contest?

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

GL & HF :D

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

zscoder , It would be great if u could ensure that questions aren't googlable _/_

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

How come it's your second contest after such a short period of time? "We have a long queue, sorry for not answering".

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

Good luck everyone and a high rating!

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

It's about one hour that I submitted a code, and it's still in queue!

hope there be no long queue during the contest.

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

Salute! Prolific problemsetter(potential writer of Round 373:P

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

Hope this time Codeforces's Server will Work Properly not like the last time ... Very disappointed with the last contest that that turned out to be UNRATED !!!

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

I think there is schedule conflict with SRM698 (1:00 AM GMT+9). Could we change the start time earlier or other day?

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

What is good to have a Korean problem setter?

NOW WE HAVE A FEASIBLE COMPETITION TIME FOR EAST ASIA. You are my hero man

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

Last round of zscoder div2 B's test case was absolutely amazing . Pretest was passed in the contest for B , but i got wrong ans on test no. 116 . How amazing it is !

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

Thank you ~~~~~ zscoder ~~~~~ for writting this contest :) the last contest you wrote was very cool.. Hope it will be also :)

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

Good luck everyone and happy rating

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

Has the server issue been solved? round 370 became unrated for this.

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

thanks zscoder for your awesome contribution in codeforces.

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

i hope problems will have ideas this time because problem A&B in the previous round were just about coding with no ideas

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

This is my last contest before my school starts :( Gotta do well this time.

GL & HF everyone.

:)

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

Oh no, can you please make the contest time as usual as it was :(

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

good luck and high rating~

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

مش لازم تحشر اسمك ف كل المسائل .... فاكس الجو بتاع السبكي ده :V

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

Maybe we can have more animals in coming contest's problems. I really enjoyed them xD. And sorry who is the Chris ???

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

Hope the round will as interesting as zscoder's last round.

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

i hope it will contain more thinking and less knowledge , and good luck for everyone .

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

Good luck and have a hight rating, thanks you every one.

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

What does the tag "multiple-of-three-again" mean ? :"D

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

GL and high rating everyone!

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

Auto comment: topic has been updated by zscoder (previous revision, new revision, compare).

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

Can I rush into Div.1? jump ahead////

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

10 min delay.

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

why you guys do this at very last time? (the delay) :3

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

Swarm of comments about delay incoming...

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

:/

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

Now much smaller gap between Codeforces round and Topcoder SRM

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

The dalays are really annoying when I make plans taking into account the time and duration of a CF contest. Now I have a date and will have to leave 10 minutes before the contest ends, and I'm sure a lot of people are in the same situation. :/

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

Div 2 round starts 1 second after div 1. XD

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

Div2B Pretest 6 is messing up a lot of people this contest

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

Div2 B should specify that all '?' those that are not in the 26 range solution must also be replaced.I think even though many people got the logic right, not including this fact is giving them many penalties.

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

    i didn't just forget the "?"s but i kept outputing only the 26 letters substring , even when i fixed that i forgot replacing the "?"s . it was pretty clear in the problem statement but i didnt fully read it :( " This string should match the string from the input, except for the question marks replaced with uppercase English letters "

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

    Fuck. They have put wrong words in bold.

    'all the question marks with uppercase letters' should be ' all the question marks with uppercase letters'.

    Or even better:
    ' ALL the question marks with uppercase letters'

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

    The problem states: This string should match the string from the input, except for the question marks replaced with uppercase English letters. There is no reason to believe it is enough to replace a minimal amount of question marks.

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

Why do I have a wrond answer for presest 1??? Help me please. My answer for 1 pretest is the same as a correct one. here is the code:

map<char, int>a;

int main(){ ios::sync_with_stdio(false); string s; cin >> s;

string ss = "";
if (s.size() < 26)
{
    cout << -1 << '\n';
    return 0;
}

bool o = 0;
int l = 0;
for (int i = 0; i <= s.size() - 26; ++i)
{
    a.clear();
    bool ok = 1;
    string str = "";
    for (int j = i; j <= i + 26; ++j)
    {
       a[s[j]]++;
       str.push_back(s[j]);
       if (s[j]!='?'&&a[s[j]] > 1){
         ok = 0;
         break;
       }

    }

    if (ok)
    {
       ss = str;
       o = 1;
       l = i;
       break;

    }
}


for (int i = 0; i < ss.size(); ++i)
{
    if (ss[i] == '?')
    {
       for (char c = 'A'; c <= 'Z'; ++c)
       {
         if (ss.find(c) == ss.npos)
         {
          ss[i] = c;
          break;
         }
       }
    }
}

if (!o)cout << "-1" << '\n';
else {
    for (int i = 0; i < l; ++i)

       cout << s[i];

    for (int i = l; i <= l + 26; ++i)
       cout << ss[i - l];

    for (int i = l + 26 + 1; i < s.size(); ++i)
       cout << s[i];
}

}

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

C is too hard :/

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

Sadness is when you code D, but can't submit because you didn't solve anything else, and there's only time to solve A, and you don't even know if D will pass, so you don't want to risk it, so you're just sitting there, waiting for the contest to be over :(

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

Missed D by a second :/

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

Can someone explain solution for Div.2 C? I got TLE on pretest 5 :/

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

I wish I had the time to participate the contest, when I came back from other stuff I solved the div2 questions pretty quickly. Feels bad to miss a train straight towards purple.

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

How to solve Div1 B?

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

    It scares me when I spend 2 hours coding something and then a much stronger coder asks how to solve it :S

    Now I'm confused if I'm right. Well, at least I won't lose ratings.

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

    How I've tried:

    Set all unknown edges to 1.

    Find shortest path s->t (assume it's equal to L2)

    Then if L2 > L then there is no answer. Else if L2 = L, output graph else Count all edges on shortest path (assume cnt). If cnt = 0 then no soluton.
    one of edges set to L — L2 + 1. All other edges (outside shortest path) set to INF.

    But I didn't send my solution.

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

    I had an idea and although I couldn't finish it in time, I will explain it because I believe it's correct. The minimum weight we can use for each edge is 1, so let's use it for every single edge with erased weight. Find the shortest path, say L'. If L'>L, then no solution. if L'==L, then we have found a solution. Assume L'<L and D=L-L' and again put 1 on every edge that doesn't have weight. Let's loop over the edges that have no weight and make the current weight from 1 to 1+D. After doing it for the current edge, let's find the shortest path and if it is L, we are done. Otherwise, it will be less than L and we can continue the process with the other edges. To do that fast, we can just binary search for the last edge that got its length increased before the shortest path became L :)

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

    Is my solution right? I hope it will pass the pretest.

    1, Run Dijkstra to find a shortest path (1).

    2, Assign the weights of "erased" edges on shortest path (1).

    3, For other "erased" edges, assign weight 10^15 (so (1) has more chances to be a shortest path of length L)

    4, Dijkstra again to check.

    5, Print the result.

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

    I didn't participate in the contest, but keeping an upper and lower bound of a node and run a Dijkstra should be a good idea.

    When visit a node: if a nearby edge is weighted do the same thing as Dijkstra and set the underground to the distance, and if there is no question marked edge then also set the lower bound to it. If there is a question mark edge, set the lower bound to dist+1 and upper bound to INF-1.

    Of course the Dijkstra will be ran under the upperbound.

    *I am a bit drunk right now, so I may miss out something important, and yes I typed "hit" instead of "bit" before I revised this...

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

    I thought to find all the simple paths between S and T. If on any one path number of zero weights >= (L-remaining weight on this path) then answer exist else answer doesnot exist.

    Now on this path we replace all zero weights by one except the last zero weight. On the last zero weight edge we put weight = L - X where X= number of zero weights on this path-1

    Now we can put INF on rest of zero weight edges so the given condition gets satisfied. I could not implement within the contest time. :( Can someone comment on the correctness of this solution ?

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

Really, really good problems, thank you! :) I decided to start with C and finished it 15 minutes before the end. However it was better not to submit it without having another problem solved so I started B but couldn't finish coding it, both B and C were pretty nice :) I will send this code when system test is done, let's see if it passes :)

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

C Div 2. Anyone? How to solve it?

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

I like this round. Problems are so interesting!

I hope my rating will be increased.

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

Can someone explain the solution of Div.2_B? I don't know why my code is wrong. so i want to compare right solution :>

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

Auto comment: topic has been updated by zscoder (previous revision, new revision, compare).

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

plz don't open round more or I'll hate you

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

20709423 This is the submission for Div 2 B Can anyone tell me why this one fails on PRETEST 6

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

I really liked problem B! But I don't understand the reason behind its constraints. Does the solution intended to get AC? (Considering the 4s time limit...)

I had that solution but thought it'd fail. I was hoping to find O(n2 + nm) solution (or something like that), but I came up with an one!

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

    could you explain your solution please

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

      I think you can understand the whole solution by just looking at my submission! 20704461

      A brief description:

      First, consider the weights of erased edges equal to 1. Then run dijkstra and find the distance from s to any other vertex. Let d[v] be the distance between s and v.

      Let need be L - d[t]. Now run another dijkstra from s. We are aiming to add need to the distance from s to any other node that we could! When you are relaxing an edge vu, check if you can change the weight of this edge in order not to make the distance from s to u less than d[u] + need.

      So in the second run of dijkstra we add this extra if before relaxing the edge e = vu:

      if(isErased[e] && dist[v] + w[e] < d[u] + need)
      	w[e] = d[u] + need - dist[v];
      
»
10 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +16 Проголосовать: не нравится

Problems are really interesting and challenging, great!

Some personal feelings:

1.The difficulty progression from D2.C to D2.D is really harsh, I failed to figure out any workable solution in last half of the contest.Anyway, it's a good problem.

2.D2.C will give a really short constructive solution.It's beautiful, but also lost some fun of hacking.

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

I don't think this is a good codeforces round. No offence... Maybe just that i'm not good at solving these problems... My rating... Excited

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

Maybe many-people thought "What the hell B pretest 6?"

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

Problem Div 2D. Is it true that we have to find shortest path that contain the least amount of erased edge?

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

Please help!!! I dont know whats wrong with those B->http://mirror.codeforces.com/contest/716/submission/20707069 C->http://mirror.codeforces.com/contest/716/submission/20710823

Its more likely that I am wrong in C..... I understand the editorial but I dont know whats wrong with mine

»
10 лет назад, скрыть # |
Rev. 6  
Проголосовать: нравится +10 Проголосовать: не нравится

Allow solutions with finding 1/x (modulo mod) using mod — 2 as a power instead of phi(mod)-1 pass pretests in Div1C is the evilest thing I've ever seen :D

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

As I am unable to submit because of pending systests, can someone look at my code for div 2 D and let me know if it will pass?

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

Всем привет:) Помогите понять, как работает этот код по Adiv2 на тесте
~~~~~
1 2
3
~~~~~
Это решение читает N+1 чисел. Может кто объяснить, как работает scanf ?

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

Problem Div2-B 716B - Complete the Word was similar to this recent problem 701C - They Are Everywhere. I just copied my solution from that round.

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

I was printing only 26 letters for Div2B. OMG.

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

Div 1B RIP.

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

.

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

RIP B :( div1 & div2

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

Auto comment: topic has been updated by zscoder (previous revision, new revision, compare).

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

zscoder is really lucky for me. In his last round, I got  + 119 and now expecting  + 130.

The questions were really nice! Hope to see more rounds from you :D

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

Can anyone tell me why am I getting WA here.
It reads WA on 9 because "Integer 0 violates the range [1, 1000000000000000000]" whereas 0 is the vertex not the weight.
This looks fishy. Anybody any clues?

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

Very Very Very bad round for me! Back to Earth Again After flying high last time out

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

Eagerly waiting for editorial

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

Auto comment: topic has been updated by zscoder (previous revision, new revision, compare).

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

Finally became blue for the first time today :) :D

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

What in 22 test in div1 B?

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

What is correct answer for test case #44 for problem B. Is it -1.

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

    I got wrong answer on test case 44 for problem B (Div2). That happened because I misread the question and instead of looking for substring I looked for subsequence.

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

I liked the prerequisites section for each problem in the editorial, that is very helpful. Hope that next editorials will have this section.

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

How to get full test of any problem in problemsets? Not just the first few numbers.

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

LOL worse did this contest and got +644.

Does this set a record? :D

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

In div2 B pretest 6, http://mirror.codeforces.com/contest/716/submission/20710802

Seriously,is that a bug?

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

In the second problem the required output is : "If there is no way to replace all the question marks with uppercase letters such that the resulting word is nice, then print  - 1 ". so I understand that i should print the nice sub string which contains the letter only once and all the alphabet letters .. so how could test six be correct ? I mean , the problem statement is not clear enough concerning this part that i should print the whole string not only the required nice sub string

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

Please check this out , my submission for div 2B #372 Running the same code on ideone and my pc gives me correct answer , while CF compiler does something else. Is it some bug, costed me rating loss , please check ... Help me out if i am doing wrong somewhere! Ideone link — http://ideone.com/tJdGrc My submission link CF — http://mirror.codeforces.com/contest/716/submission/20716292

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

Great Contest It Was... Thanks To ZS-the-Coder !!! Waiting for your next one ...

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

Div. 2 B solution with using regexes 20716509, Perl.

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

Hey guys can you help me with something at problem div2 D? :)

If you replace all zeroes with 1 and you run Dijkstra you should obtain the shortest path from S to T.

If it is less than L, then it should be a solution.On this path(which contains now 1 instead of zeroes) you transform an 1 in a number which should make this path's length L.The rest of zeroes in the graph(which were transformed in 1) should become a huge number as 10^18.

Why this approach doesn't work? I mean if it were to be another path from S to T lower than the path we just transformed, it could be just in one condition.There was an path which contained no 0 in the first place because if it were to be a path with an zero, it would have become a number which surpasses L in the first place.

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

    Consider this test:

    4 4 5 0 3 
    0 1 0
    1 3 0
    1 2 2
    2 3 1
    

    After changing zeros to ones you get the shortest path from 0 to 3: 0-1-3

    Its length is 2, so you need to add 3 to one of the edges. If you choose 1-3 (because there's no reason not to choose it), the length of this path becomes 5. However, the shortest path from 0 to 3 is now 0-1-2-3 with length 4.

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

Hi Guys! I got a runtime error on test 84 in Div2 B problem. Here the length of the string is less than 26. But my loop is as follows: for(i=0;i<=s.length()-26;i++) and it gives rte but instead if i store s.length()-26 in a variable,say p, and write the loop as for(i=0;i<=p;i++) its getting accepted. Can you please give me a reason as to why this is happening? My rte code: http://mirror.codeforces.com/contest/716/submission/20693471 My ac code: http://mirror.codeforces.com/contest/716/submission/20713665 Please help me out. Thanks in advance!

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

I sign up Codeforces Round #372 yesterday and joined the competition and AC THE A,B,C.But today,when I log in and search my contests "Codeforces Round #372"disapear and I can't know my score.Why? who can help me?

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

I know I shouldn't be asking this kind of question, but

can anyone who sees this comment please please explain where am i going wrong in this code for Complete the Graph. I am calculating minimum distance from t to all other vertices and then calculating minimum distance from s and updating the edges. I have also tried commenting my code for first time to make it easier to understand. Please help me. I have been stuck on this question for 8 days and now I am finding it hard to move on from this.

I would really appreciate your help.

Please help