| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 43254 | hanyihong | 【J】T1 | C++ | 通过 | 100 | 0 MS | 252 KB | 411 | 2026-10-28 13:58:08 |
#include<bits/stdc++.h> #define int long long using namespace std; int n,s,ans; int sum(int n){ int res=0; while(n){ res+=n%10; n/=10; } return res; } signed main(){ cin>>n>>s; if(s>=n){cout<<0;return 0;} for(int i=s;i<=n;i++){ if(i-sum(i)>=s){ cout<<n-i+1; return 0; } } cout<<0; return 0; }