代码提交不上去
  • 板块工单反馈版
  • 楼主Tairano
  • 当前回复2
  • 已保存回复2
  • 发布时间2020/12/8 15:33
  • 上次更新2023/11/5 06:25:08
查看原帖
代码提交不上去
122367
Tairano楼主2020/12/8 15:33

一提交就显示vjudge.uva_public_account,然后打开记录就是waiting,题目是这道UVA10474 大理石在哪儿 Where is the Marble?--其他的题都可以提交,唯独我的这段代码= =

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int n,q,a[1000],b[1000];
int main (){
	while(1){
		cin>>n>>q;
		if(n==0&&q==0)
			return 0;
		for(register int i=1;i<=n;i++)
			cin>>a[i];
		sort(a+1,a+1+n);
		for(register int i=1;i<=q;i++)
			cin>>b[i];
		printf("CASE# %d:\n",q);
		for(register int i=1;i<=q;i++){
			bool vis=0;
			for(register int j=1;j<=n;j++){
				if(a[j]==b[i]){
					vis=1;
					printf("%d found at %d\n",b[i],j);
					break;
				}
			}
			if(!vis){
				printf("%d not found\n",b[i]);
			}
		}
	}
	return 0;
} 
2020/12/8 15:33
加载中...