|
|
вернуться в форумWhy WA? #include <vector> #include <algorithm> #include <iostream> typedef unsigned long number; int main () { int size; std::vector<number> data; data.reserve (250000); std::cin >> size; for ( int i=0; i<size; ++i ) { data.push_back (0); std::cin >> data[i]; } std::sort ( data.begin(), data.end() ); if ( size%2 ) { std::cout << data[(size+1)/2-1]; } else { number l = data[size/2-1]; number r = data[size/2]; switch ( (l%2) + (r%2) ) { case 0: std::cout << l/2+r/2; break; case 1: std::cout << l/2+r/2 << ".5"; break; case 2: std::cout << l/2+r/2+1; break; } } return 0; } Re: Why WA? damn! they used different output format |
|
|