站外题超时
  • 板块学术版
  • 楼主QWQ_jyc
  • 当前回复5
  • 已保存回复5
  • 发布时间2022/9/26 20:22
  • 上次更新2023/10/27 09:52:10
查看原帖
站外题超时
760850
QWQ_jyc楼主2022/9/26 20:22
#include<iostream>
using namespace std;
int a[105][105];
int main(){
	int n,m,x,y,cut;
	cin>>n>>m;
	for(int i=0;i<=n;i++){
		for(int j=0;j<=m;i++){
			cin>>a[n][m];
		}
	}  
	cin>>x>>y;
	for(int i=0;i<=n;i++){
		if(a[x][i]==1){
			cut++;
		}	
}
    for(int j=0;j<=m;j++){
		if(a[j][y]==1){
			cut++;
	}
}
	if(a[x][y]==1){
		cut--;
}
	cout<<cut;
	return 0; 
}

超时怎么办???

2022/9/26 20:22
加载中...