12.08周赛Problem G

题目:https://vjudge.net/contest/274223#problem/G
解题思路:开动态数组,然后把数存进去,用选择排序法找出最小的数(气死我了!!!!输出的时候少了个冒号,提交的时候竟然显示WA 害我检查半天还找不出错误)

#include
using namespace std;
int main()
{
int x,s=1,i;
cin>>x;
while(s<=x)
{
int n,m,t1=0;
cin>>n>>m;
int *a;
a=new int[n];
for(i=0;i {
cin>>a[i];
if(a[t1]>a[i]) t1=i;
}
if(m!=0)
{
int *b,t2=0;
b=new int [m];
for(i=0;i {
cin>>b[i];
if(b[t2]>b[i]) t2=i;
}
cout<<“Problem “< cout<<“Shortest judge solution: “< cout<<“Shortest team solution: “< delete b;
}
else
{
cout<<“Problem “< cout<<“Shortest judge solution: “< cout<<“Shortest team solution: N/A bytes.”< }
s++;delete a;

}
}

你可能感兴趣的:(12.08周赛Problem G)