标签:
Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Description
Input
Output
Sample Input
Sample Output
Hint
INPUT DETAILS: Five cows with milk outputs of 1..5 OUTPUT DETAILS: 1 and 2 are below 3; 4 and 5 are above 3.
问题分析:终于有一道我能称之为水题的水题出现了0.0直接冒泡排序,再求中位数可过,不过我用的STL的sort();0.0
1 #include "iostream" 2 #include "algorithm" 3 using namespace std; 4 int *cow; 5 void cowbegin(int n) 6 { 7 int x; 8 for (int i=0;i<n;i++) 9 cin>>cow[i]; 10 } 11 int main() 12 { 13 int n,x; 14 while (cin>>n) 15 { 16 cow = new int [n]; 17 cowbegin(n); 18 sort(cow,cow+n); 19 cout<<cow[n/2]<<endl; 20 delete [] cow; 21 } 22 23 return 0; 24 }
暑假集训(2)第五弹 ----- Who's in the Middle(poj2388)
标签:
原文地址:http://www.cnblogs.com/huas-zlw/p/5697017.html