| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 43253 | 范墨涵 | 【J】T2 | C++ | 解答错误 | 0 | 0 MS | 252 KB | 440 | 2026-10-28 13:58:06 |
#include<bits/stdc++.h> using namespace std; #define int long long int n,s; int ans; bool sum(int x){ int cnt=0; int x1=x; while (x>0){ cnt+=x%10; x/=10; } if (x1-cnt>=s) return true; return false; } signed main(){ //freopen("num.in","r",stdin); //freopen("num.out","w",stdout); cin >> n >> s; for (int i=s+1;i<=n;i++){ if (sum(i)==true){ ans+=n-i+1; break; } } cout << ans; return 0; }