Submission #31013230
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
std::vector<std::string> split(const std::string& text, const char delim);
using ll = long long int;
using llu = unsigned long long int;
int main(){
string buffer;
getline(cin, buffer);
auto input_list = split(buffer, ' ');
const ll A = stoll(input_list[0]);
const ll B = stoll(input_list[1]);
const ll K = stoll(input_list[2]);
ll a = A;
int count = 0;
while(a < B){
a *= K;
++count;
}
cout << count << endl;
return 0;
}
std::vector<std::string> split(const std::string& text, const char delim){
std::vector<std::string> item_list;
std::stringstream ss(text);
std::string buffer;
const size_t NUM_ITEM = std::count(text.begin(), text.end(), delim);
item_list.reserve(NUM_ITEM + 1);
while ( std::getline(ss, buffer, delim) ) {
if (!buffer.empty()) {
item_list.emplace_back(buffer);
}
}
return item_list;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Slimes |
| User | low10603 |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 1080 Byte |
| Status | AC |
| Exec Time | 8 ms |
| Memory | 3612 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 02_max_01.txt, 03_handmade_01.txt, 04_hack_log_01.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 8 ms | 3576 KiB |
| 00_sample_02.txt | AC | 2 ms | 3612 KiB |
| 00_sample_03.txt | AC | 2 ms | 3584 KiB |
| 01_random_01.txt | AC | 3 ms | 3464 KiB |
| 01_random_02.txt | AC | 2 ms | 3504 KiB |
| 01_random_03.txt | AC | 2 ms | 3596 KiB |
| 01_random_04.txt | AC | 2 ms | 3580 KiB |
| 02_max_01.txt | AC | 2 ms | 3488 KiB |
| 03_handmade_01.txt | AC | 2 ms | 3552 KiB |
| 04_hack_log_01.txt | AC | 2 ms | 3420 KiB |