1 条题解

  • 0
    @ 2026-5-2 19:33:28
    #include <bits/stdc++.h>
    using namespace std;
    int main() {
    	ios::sync_with_stdio(false);
    	ios_base::sync_with_stdio(false);
    	cin.tie(0), cout.tie(0);
    	long long n, k;
    	cin >> n >> k;
    	int cnt = 0;
    	while (n >= k) {
    		cnt++;
    		if (n % k == 0) {
    			cout << cnt;
    			return 0;
    		}
    		n -= n / k;
    	}
    	cout << 0;
    	return 0;
    }
    
    
    • 1

    信息

    ID
    10245
    时间
    1000ms
    内存
    512MiB
    难度
    10
    标签
    递交数
    1
    已通过
    1
    上传者