We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e53585 commit 5456daeCopy full SHA for 5456dae
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