|
|
back to boardC++ solution! Posted by yaho0o0 10 Apr 2009 22:28 #include <iostream> using namespace std; int main() { unsigned long long n,m; cin>>n>>m; if(m>=n) cout<<2*(n-1)<<endl; if(n>m) cout <<2*(m-1)+1<<endl; return 0; } Re: C++ solution! Orz...My solution is so complex... Re: C++ solution! Posted by saibogo 28 Jun 2012 22:34 You can even simpler)) #include <iostream> using namespace std; int main() { unsigned long long iN, iM; cin >> iN >> iM; cout << min(2 * (iN - 1), 2 * (iM - 1) + 1); return 0; } Re: C++ solution! You don't really need unsigned long long. Got AC with unsigned int. |
|
|