diff --git a/Codes/1986 A - X Axis/1986A.cpp b/Codes/1986 A - X Axis/1986A.cpp new file mode 100644 index 0000000..423a974 --- /dev/null +++ b/Codes/1986 A - X Axis/1986A.cpp @@ -0,0 +1,30 @@ +#include +using namespace std; +#define ll long long +#define endl '\n' +ll pow(ll x,ll y,ll m=1e9+7){ll ans=1;x%=m;while(y){if(y&1)ans=(ans*x)%m;x=(x*x)%m;y>>=1;}return ans;} + +void solve() +{ + int a,b,c; + cin>>a>>b>>c; + int mn = INT_MAX; + for(int i=1; i<=10; ++i) + { + int diff = abs(a-i)+abs(b-i)+abs(c-i); + mn = min(diff, mn); + } + cout<> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "< +using namespace std; +#define ll long long +#define endl '\n' +ll pow(ll x,ll y,ll m=1e9+7){ll ans=1;x%=m;while(y){if(y&1)ans=(ans*x)%m;x=(x*x)%m;y>>=1;}return ans;} + + +void solve() +{ + ll n,m; + cin>>n>>m; + vector> v(n, vector(m)); + for(ll i=0; i>v[i][j]; + } + for(int i=0; i=0) + mx=max(mx, v[i-1][j]); + if(j+1=0) + mx=max(mx, v[i][j-1]); + if(v[i][j]>mx) v[i][j] = mx; + cout<> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "< +using namespace std; +#define ll long long +#define endl '\n' +ll pow(ll x,ll y,ll m=1e9+7){ll ans=1;x%=m;while(y){if(y&1)ans=(ans*x)%m;x=(x*x)%m;y>>=1;}return ans;} + +void solve() +{ + int n,m; + cin>>n>>m; + string s,c; + cin>>s; + setst; + for(int i=0; i>x; + st.insert(x); + } + cin>>c; + sort(c.begin(),c.end()); + vectorv; + for(auto x:st) v.push_back(x); + for(int i=0; i> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "<