ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1367. Top Secret

What is the answer for this testcase?
Posted by Deepesson 9 Jan 2021 01:49
#+-+-+-+-+-+
+-+-+-+-+-+#

Edited by author 09.01.2021 01:54
Re: What is the answer for this testcase?
Posted by Deepesson 9 Jan 2021 02:37
Ok, stupid mistake again.
Basically, the last line will be always \n
So if you did something like this to read the input:
std::string s;
while(!std::cin.tie(0)){
     std::cin >> s;
}
The Program will read an empty string.
So you need to read as:
while(!std::cin.tie(0)){
     std::cin >> s;
     if(!s.size())break;
}
I got WA #6, So I thought my diagonal code was wrong! Lol.

Edited by author 09.01.2021 02:47

Edited by author 15.01.2021 03:31

Edited by author 15.01.2021 03:32

Edited by author 15.01.2021 03:32
Re: What is the answer for this testcase?
Posted by Deepesson 9 Jan 2021 02:38
Btw the correct answer is:
11
11