995
查看原帖
995
1313277
suyouyu1234楼主2024/12/14 15:03
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n,ans;
int x;
int a,b,c,d,e;
int y[8];
int main(){
	cin>>x>>n;
	if(x==0){
		cout<<"0 0 0 0 0"<<endl;
		cout<<"0"<<endl;
		return 0;
	}
	for(int i=1;i<=n;i++){
		int h;
		cin>>a>>b;
		h=max(a,b);
		cin>>c;
		h=max(h,c);
		cin>>d;
		h=max(h,d);
		cin>>e;
		h=max(h,e);
		y[h]++;
		x-=h;
	}
	for(int i=1;i<=5;i++){
		cout<<y[i]<<' ';
	}
	cout<<endl<<x;
	return 0;	
}
2024/12/14 15:03
加载中...