The recent testing round went well. It is expected that everything will run faster. Today's round was prepared by: Mike Mirzayanov, Nickolay Kuznetsov, Ivan Fefer and Maria Belova.
2nd one is a little bit confusing.. Especially "If those rules don't indicate the size of the cut are clearly, then the way with which the cut part possesses the largest area is chosen."
I have a little question about a challenge case in problem A of today's contest. In my room one coder wrote a subroutine where he checked for every address whether it matches with the "input" string. In order to do that, he run a for loop which checked character by character whether the "input" string matches with any of the addresses. His for loop runs like this:
for ( int i = 0 ; i < input.size() ; i ++ ) {
if(input[i]!=current_address[i]) break;
}
Now my question, shouldn't there be a runtime error when the size of the input is bigger than the current_address, given all the other characters are equal?
I challenged it and it failed. Can anyone explain why?
It banged, crashed, exploded. Still, I agree that if current_address is char[], then the code will not crash and everything will go smoothly, exactly because of the '\0' character you spoke of.
so, those who are not in div2, were not allowed to open any solution? or it was a problem here? I just wanted to see some people's code (no intention was for hacking :P) but it didn't allow me to do so...
In problem B test 7, the input is 99 100 and the answer is 80 64. But what if the answer is 64 80? My program told me the latter answer and I think it's more reasonable--people would usually like to cut pictures as consistent with the origin ratio as possible, wouldn't they?
So I tried the following:
int main()
{
string str = "codeforces";
cout << str[11] << endl;
return 0;
}
It banged, crashed, exploded. Still, I agree that if current_address is char[], then the code will not crash and everything will go smoothly, exactly because of the '\0' character you spoke of.
hehe...
I will happier even to float at "yellow-red" border.. :)
In problem B test 7, the input is 99 100 and the answer is 80 64. But what if the answer is 64 80? My program told me the latter answer and I think it's more reasonable--people would usually like to cut pictures as consistent with the origin ratio as possible, wouldn't they?