Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
11592 | ydks | 【USACO】奶牛聚集 herding(USACO 2019) | C++ | 通过 | 0 MS | 248 KB | 406 | 2022-10-06 14:03:11 |
#include<bits/stdc++.h> using namespace std; #define x1 x[0] #define x2 x[1] #define x3 x[2] int x[3]; int main(){ //freopen("tmp.in", "r", stdin); cin >> x1 >> x2 >> x3; sort(x, x + 3); int ans1; if(x2 - x1 == 2 || x3 - x2 == 2) ans1 = 1; else ans1 = 2; int ans2 = 0; ans2 = max(x2 - x1 - 1, x3 - x2 - 1); ans1 = min(ans1, ans2); cout << ans1 << endl<< ans2; }