WA一个(第三个WA了)

P1150 Peter 的烟

huangzicheng114514 @ 2024-09-20 21:46:20

#include<bits/stdc++.h>
using namespace std;
#define ii int
#define ll long long
#define cc char
#define dd double
#define in cin
#define out cout
#define pp printf
#define bb bool
int main()
{
    ii a,k,sum=0,s=0;in>>a>>k;
    while(a){
        sum=a;
        s+=sum;
        sum/=k;
        sum=a-sum*k;
        a/=k;

        //TODO
    }cout<<s;
    return 0;
}

by lizechenQAQ @ 2024-09-20 21:54:51

6


by huangzicheng114514 @ 2024-09-20 22:01:09

@lizechenQAQ 啥意思???


by lizechenQAQ @ 2024-09-20 22:01:58

@huangzicheng114514 define感觉没必要


by huangzicheng114514 @ 2024-09-22 10:23:12

我习惯了 @lizechenQAQ @lizechenQAQ @lizechenQAQ @lizechenQAQ @lizechenQAQ @lizechenQAQ @lizechenQAQ @lizechenQAQ @lizechenQAQ


by lizechenQAQ @ 2024-09-22 10:26:12

@huangzicheng114514 hhh
验证码


by liuzhouyang @ 2024-10-01 17:36:54

@huangzicheng114514 本人提供 hack 数据:

#3 Input:

10 2

AC Output:

19

Your code Output:

18

by CCF_NOIP_ @ 2024-10-08 21:12:32

#include<bits/stdc++.h>
using namespace std;
int a,ans,k;
int main(){
cin>>a>>k;
for(int i=1;i<=a;i++){
    ans++;
    if(i%k==0){
        a++;
    }
}
cout<<ans;
}

废了,没我这个菜鸡强。


|