Last week we had a local Contest available [here](https://mirror.codeforces.com/group/WYIydkiPyE/contests) (statements only in portuguese), and I was surprised when the easiest problem was getting a lot of Wrong Answers on test 1. All of them seemed correct, gave the correct output locally and were using GNU C11. For some reason, re-submitting the **same** code in GNU C++ gave AC. Why?↵
↵
Problem Statement↵
------------------↵
Given the formula of gravitational attraction $F = \frac{G\cdot M_1 \cdot M_ 2}{d^2}$, find the value of $G$ given the mass of the 2 objects, the force and their positions on space (which is only a line).↵
↵
The code↵
------------------↵
![ ](/predownloaded/30/e5/30e520b72538b8463e332b2d39968ce402e90ff3.png)↵
↵
[WA on 1](https://mirror.codeforces.com/group/WYIydkiPyE/contest/450037/submission/211621845)↵
↵
[AC](https://mirror.codeforces.com/group/WYIydkiPyE/contest/450037/submission/211621819)↵
↵
After seeing this, I made an announcement for people to submit their problem using GNU C++ and a ton of AC came in... as a setter I was frustrated by such a bug and want to know why that happened :(
↵
Problem Statement↵
------------------↵
Given the formula of gravitational attraction $F = \frac{G\cdot M_1 \cdot M_ 2}{d^2}$, find the value of $G$ given the mass of the 2 objects, the force and their positions on space (which is only a line).↵
↵
The code↵
------------------↵
![ ](/predownloaded/30/e5/30e520b72538b8463e332b2d39968ce402e90ff3.png)↵
↵
[WA on 1](https://mirror.codeforces.com/group/WYIydkiPyE/contest/450037/submission/211621845)↵
↵
[AC](https://mirror.codeforces.com/group/WYIydkiPyE/contest/450037/submission/211621819)↵
↵
After seeing this, I made an announcement for people to submit their problem using GNU C++ and a ton of AC came in... as a setter I was frustrated by such a bug and want to know why that happened :(