解题思路:
注意事项:
参考代码:
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
int n;
while(cin>>n){
int *p=new int [n];
int res=0;
for(int i=0;i<n;i++){
cin>>*(p+i);
}
sort(p,p+n,greater<int>());
for(int i=0;i<n;i++){
int temp;
cin>>temp;
int j;
for(j=0;j<n;j++){
if(*(p+j)<temp && *(p+j)){
res++;
*(p+j)=0;
break;
}
}
if(j==n){
for(j=n-1;j>=0;j--){
if(*(p+j) && *(p+j)==temp){
*(p+j)=0;
break;
}
}
if(j==-1) res--;
}
}
cout<<res*50<<endl;
}
return 0;
}
0.0分
1 人评分
C语言训练-求PI* (C语言代码)浏览:613 |
C语言训练-尼科彻斯定理 (C语言代码)浏览:463 |
WU-整数平均值 (C++代码)浏览:1236 |
2005年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:646 |
Hello, world! (C++代码)浏览:1743 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:542 |
1025题解浏览:732 |
蛇行矩阵 (C语言代码)浏览:498 |
字符串比较 (C语言代码)浏览:679 |
JAM计数法 (C语言代码)浏览:665 |