标签:first ted ++ least bsp class cat using kill
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others)
Total Submission(s): 34530 Accepted Submission(s): 15051
#include <cstdio> #include <algorithm> using namespace std; int a[1000001]; int main() { int n; while(~scanf("%d",&n)) //!!!不加会超时 { // ~ !=EOF for(int i=0;i<n;i++) scanf("%d",&a[i]); sort(a+1,a+n+1); printf("%d\n",a[(n+1)/2]); //巧妙之处 } return 0; }
HDOJ 1026 Ignatius and the Princess I
标签:first ted ++ least bsp class cat using kill
原文地址:http://www.cnblogs.com/biggan/p/7448225.html