Bactérias

Problem Link

Solution by Mr.Olimpia — 100 pts

Code / Notes

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    int p;
    long long q=1;
    int ans=0;
    cin >> n >> p;
    while(q*p<=n){
        q=q*p;
        ans++;
    }
    cout << ans;
}

Last updated 4 months ago


« Back to problem