1. 程式人生 > >水題,模擬題,但仍需細心,多考慮

水題,模擬題,但仍需細心,多考慮

== stream clas axis nbsp space sin clu 水題

//http://codeforces.com/contest/1065/problem/B
#include <iostream> #include <cmath> using namespace std; int main() { long long n,m,num,s,a,b,c,minIS,maxIS; cin>>n>>m; if(n<2*m) { minIS=0; } else { minIS=n-2*m; } if(m==2) { maxIS
=n-3; } else if(m==0) { maxIS=n; } else { maxIS=n-(1+(sqrt(1+8*m)))/2; } cout<<minIS<<" "<<maxIS<<endl; return 0; }

水題,模擬題,但仍需細心,多考慮