|
|
вернуться в форумlittle solution)) #include <iostream> using namespace std; __int64 min(__int64 x, __int64 y) { return (x > y) ? y : x; } __int64 val(__int64 x) { if (x > 0) return 3; if (x == 0) return 1; return 0; } int main(){ __int64 k, l, n, t; cin >> k >> l >> n; t = min(k, n - 1); __int64 maxr = 3 * t + n - 1 - t + val(k - t - l); t = min(l, n - 1); __int64 minr = n - 1 - t + val(k + t - l); if (k + t - l == 1 && t >= 1) minr--;// for tests 1 1 3 and 1 1 2, because we change win + lose to 2 draws cout << maxr << ' ' << minr; return 0; } Re: little solution)) Послано Kit 19 мар 2007 09:34 Yeah, it's nice :) Re: little solution)) Послано svr 19 мар 2007 09:44 There is site where most compact and unexpected C-programs competes. But I prefer to combine Pascal clearness and C- libries in some my own style Re: little solution)) Послано awpris 21 мар 2007 00:55 Your answer for the test? 1 1 1 ... |
|
|