Bactérias

Problem Link

Solution by Mr.Olimpia100 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 1 week, 1 day ago


« Back to problem