What is Opportunity Cost?
Definition. The opportunity cost (OC) of any alternative is the value you place on the best of the forgone alternatives.

If we adopt the above definition (and I do), the OC of $B$ is the value of $A$, which is simply $\$100$. 

With the above definition, the alternative you choose ($B$ in this case) is completely irrelevant when calculating its OC. All that matters is the best of the forgone alternatives.

To illustrate this point, consider this pair of examples:


  Example #1. $A$ and $B$ are the only two alternatives. $A$: "Pay $\$500$ to get back $\$600$ in return." $B$: "Pay $\$500$ to get back $\$450$ in return." The OC of $B$ is the value of $A$, which is $\$100$.
  
  Example #2. Everything is exactly the same as before, except that now $B$ is changed to "Pay $\$500$ to get back $\$1,000$ in return." The OC of $B$ is again the value of $A$, which is $\$100$.


In the above examples, the value of $B$ changes (from $-\$50$ to $\$500$) but that of $A$ doesn't. And so, the OC of $B$ is $\$100$ in both examples. 

An alternative's value is completely irrelevant to its OC. What's relevant is the value of the best alternative forgone.



Notes. "What exactly is OC?"

This seemingly-simple question was discussed in the past (see e.g. Alchian, 1968). Then like many of the most important questions in economics, it was then forgotten/glossed over until Ferraro &amp; Taylor (2005) and the susbequent literature spawned (see in particular the 2016 JEE Symposium).

It all boils down to which definition you use. My view (and I believe also that of Alchian and Buchanan, 1987) is that the above definition is the "most correct" one that "everyone should use". Of course, whoever's marking your homework may disagree.