|
|
back to boardWhat is the answer for this testcase? #+-+-+-+-+-+ +-+-+-+-+-+# Edited by author 09.01.2021 01:54 Re: What is the answer for this testcase? 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? Btw the correct answer is: 11 11 |
|
|