How does this code works in c++? : <p>I participated in Codeforces Round #396 (Div. 2) yesterday.
The (A) problem seemed pretty advanced in my opinion when I read it.
I tried solving it all the competition time yesterday and some time today.
I came up with a 200 lines long(half-working) solution. And then I gave up.</p>

<p>I looked what other people wrote there and I saw max 20 lines long code that seems magic to me.</p>

<p>The problem asks you to output the length of the longest uncommon subsequence of letters from two strings.
You can read the full problem here:
<a href="http://codeforces.com/contest/766/problem/A" rel="nofollow noreferrer">http://codeforces.com/contest/766/problem/A</a></p>

<pre><code>#include&lt;bits/stdc++.h&gt;
using namespace std;
string a,b;
int main(){
    cin&gt;&gt;a&gt;&gt;b;
    printf("%d",a==b?-1:max(a.size(),b.size()));
    return 0;
}
</code></pre>

<p>This is all the code used to solve the problem, and I really want to know how that one line of code</p>

<pre><code>printf("%d",a==b?-1:max(a.size(),b.size()));
</code></pre>

<p>can solve this "advanced" task?</p>
