Bactérias

Problem Link

Solution by JAPAMISTERIOSO100 pts

Code / Notes

// Source: https://usaco.guide/general/io

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

int main() {
int N;
cin >> N;
int p;
cin >> p;
int P = 1; // quantidade agora
int i=0; // dias
while(P<=N){
    P = p*P; 
    i++;
}
cout << i-1;
}

Last updated 1 month, 3 weeks ago


« Back to problem