We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fbaa886 + 5456dae commit 451a8fcCopy full SHA for 451a8fc
solutions/general/usaco-807.mdx
@@ -93,13 +93,9 @@ int main() {
93
* out whether it is the smallest and best case scenario for teleporting
94
*/
95
int dist = abs(a - b); // calculate the distance without travel
96
- if (dist > abs(a - c) + abs(b - d) {
97
- dist = abs(a - c) + abs(b - d);
98
- }
+ if (dist > abs(a - c) + abs(b - d)) { dist = abs(a - c) + abs(b - d); }
99
// repeat this again with the other possiblity given below
100
- if (dist > abs(a - d) + abs(b - c) {
101
- dist = abs(a - d) + abs(b - c);
102
+ if (dist > abs(a - d) + abs(b - c)) { dist = abs(a - d) + abs(b - c); }
103
104
cout << dist << endl;
105
}
0 commit comments