90,第三个点过不去

P1150 Peter 的烟

霍然hy @ 2019-06-20 19:12:47

include<iostream>

using namespace std; int main() { int a, b; cin >> a >> b; int c = a / b; int d = 0; while ((c+a%b+c%b-1)>=b) { d++; c -= b; } cout << d + a / b + a; return 0; } 请大佬看看啊?


by Retired_lvmao @ 2019-06-20 19:19:14

   include<iostream>
   using namespace std; 
   int main()
   { 
   int a, b; 
   cin >> a >> b;
   int c = a / b;
   int d = 0; 
   while ((c+a%b+c%b-1)>=b) 
   { d++; c -= b; 
   } 
   cout << d + a / b + a; 
   return 0; 
   } 

帮楼主来一波 Markdown


by Retired_lvmao @ 2019-06-20 19:19:30

使用Markdown


by Retired_lvmao @ 2019-06-20 19:21:20

你直接把那个数据套过来打表过掉不就行了吗


by 你爸爸_fuck @ 2019-06-20 19:24:50

#include<bits/stdc++.h>
using namespace std;
long long n,a;
int main()
{
    cin>>n>>a;
    cout<<n+(n-1)/(a-1);
    return 0;
}

|