Bactérias

Problem Link

Solution by mateusgrl39100 pts

Code / Notes

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

int main() {
    int N, P;
    cin >> N >> P;
    int dias = 0;
    int x = 1;
    while (x * P <= N) {
        x *= P;
        dias++;
    }
    cout << dias << endl;
}

Last updated 1 month, 3 weeks ago


« Back to problem