よじろめ覚書

私の理解度重視のソースコードです。

ABC100B - Ringo's Favorite Numbers

問題:B - Ringo's Favorite Numbers

#include <cmath>
#include <iostream>
using namespace std;

#define DIGIT 100

int getDivCount(int x_val) {
    int cnt = 0;
    while (x_val % 100 == 0) {
        x_val /= 100;
        ++cnt;
    }
    
    return cnt;
}

int main(void) {
    int d, n, num, val;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> d >> n;
    num = val = 0;
    while(num < n) {
        ++val;
        if (getDivCount(val) == d) {
            ++num;
        }
    }
    
    cout << val << "\n";
    return 0;
}

1WA。。