| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 43282 | liuyuche | 【J】T1 | C++ | 通过 | 100 | 0 MS | 260 KB | 446 | 2026-10-28 14:27:48 |
#include<bits/stdc++.h> #define int long long using namespace std; int n,s,cnt=0; bool check(int x){ int sum=0,y=x; while(y!=0){ sum+=(y%10); y/=10; } if((x-sum)>=s) return true; else return false; } signed main(){ cin>>n>>s; int i=s; if(check(n)==0){ cout<<0<<endl; return 0; } for(;i<=n;i++){ if(check(i)) break; } cout<<n-i+1<<endl; return 0; }