Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
43278 liuyuche 【J】T1 C++ Runtime Error 0 0 MS 244 KB 462 2026-10-28 14:24:42

Tests(0/10):


#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(){ freopen("num.in","r",stdin); freopen("num.out","w",stdout); cin>>n>>s; int i=s; for(;i<=n;i++){ if(check(i)) break; } cout<<n-i+1<<endl; return 0; }


Judgement Protocol: