第二个样例过不了……救救蒟蒻吧
查看原帖
第二个样例过不了……救救蒟蒻吧
551094
siyeansh楼主2021/10/12 17:26
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k,cnt=0,ans=0;
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		if(cnt>=k){
			ans++;
			cnt=0;
		}
		cnt++;
	}
	cout<<n+ans;
    return 0;
}
2021/10/12 17:26
加载中...