Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
11589 ydks 【USACO】奶牛聚集 herding(USACO 2019) C++ 解答错误 0 MS 252 KB 367 2022-10-06 14:01:36

Tests(1/10):


#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); if(x2 - x1 == 2 || x3 - x2 == 2) cout << 1 << endl; else cout << 2 << endl; int ans = 0; ans = max(x2 - x1 - 1, x3 - x2 - 1); cout << ans; }


测评信息: