样例全过,测试全错
  • 板块P10056 Water
  • 楼主15caoyichen
  • 当前回复5
  • 已保存回复5
  • 发布时间2024/1/18 18:20
  • 上次更新2024/1/18 20:48:45
查看原帖
样例全过,测试全错
983373
15caoyichen楼主2024/1/18 18:20

rt,自己造的数据也没问题,但是全WA。。。

#include<bits/stdc++.h>
using namespace std ;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int a,b,n,m=0,p=1;
	cin>>a>>b>>n;
	for(int i=0;i<b;i++){
		m=2*b;}
	if(b*n<=a){
		cout<<b*n<<"\n";
		return 0;}
	else{
		if(a%b==0){
			cout<<m<<"\n";
			return 0;}
		else{
			while(p){
			if(a%b==0) p=0;
			else a--;}
			if(a%b==0){
				cout<<m<<"\n";
				return 0;}}}
	return 0;
}

谢谢你大佬~!

2024/1/18 18:20
加载中...