标签:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1425
Time Limit: 6000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 33461 Accepted Submission(s):
9968
请用VC/VC++提交
1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 5 using namespace std; 6 7 int num[1000000+10]; 8 9 int main() 10 { 11 int n,m; 12 while (~scanf("%d%d",&n,&m)) 13 { 14 for (int i=1;i<=n;i++) 15 scanf("%d",&num[i]); 16 17 sort(num+1,num+n+1); 18 for (int i=n;i>n-m+1;i--) 19 { 20 printf ("%d ",num[i]); 21 } 22 printf ("%d",num[n-m+1]); 23 printf ("\n"); 24 } 25 return 0; 26 }
标签:
原文地址:http://www.cnblogs.com/qq-star/p/4622952.html