100 Accepted

foo.cc: In function 'int main()':
foo.cc:4:16: warning: unused variable 'm' [-Wunused-variable]
  int a,b,c,n=0,m=0;
                ^
# 状态 分数 耗时 内存占用
#1 Accepted 10 1ms 7.5 MiB
#2 Accepted 10 1ms 7.6 MiB
#3 Accepted 10 1ms 7.5 MiB
#4 Accepted 10 1ms 7.6 MiB
#5 Accepted 10 1ms 7.5 MiB
#6 Accepted 10 1ms 7.5 MiB
#7 Accepted 10 1ms 7.5 MiB
#8 Accepted 10 1ms 7.4 MiB
#9 Accepted 10 1ms 7.6 MiB
#10 Accepted 10 1ms 7.6 MiB

代码

#include<bits/stdc++.h> 
using namespace std;
int main(){
	int a,b,c,n=0,m=0;
	cin>>a>>b;
	while(b){
		cin>>c;
		if(c>a){
			n+=1;
		}else if(c<=a){
			a-=c;
		}
		b-=1;
	}
	cout<<n;
	return 0;
}

信息

递交者
题目
DJKS1009  药房管理
比赛
2024年3月等考一级题单
语言
C++ 14
递交时间
1 年前
评测时间
1 年前
分数
100
总耗时
9ms
峰值内存
7.6 MiB