diff --git a/Codeforces/112A_Petya_and_Strings.cpp b/Codeforces/112A_Petya_and_Strings.cpp new file mode 100644 index 0000000..616462c --- /dev/null +++ b/Codeforces/112A_Petya_and_Strings.cpp @@ -0,0 +1,13 @@ +//code by Nikhil Nagrale +//nikhilnagrale2 on EveryPlatform else nknagrale +#include +using namespace std; + +int main(){ + string a,b; + cin>>a>>b; + for(auto &c: a) c=tolower(c); + transform(b.begin(),b.end(),b.begin(),::tolower); + cout< +using namespace std; + +int main(){ + int t; + cin>>t; + while(t--){ + long long a,b; + cin>>a>>b; + if(a%b==0) + cout<<0< +using namespace std; + +int main(){ + int t; + cin>>t; + while(t--){ + int l,r; + cin>>l>>r; + if(2*l>r) cout<<"-1 "<<"-1"< +using namespace std; + +int main(){ + int a[4],d; + cin>>a[0]>>a[1]>>a[2]>>a[3]>>d; + int j; + set s; + for(int i=0;i<4;i++){ + j=1; + while(a[i]*j<=d){ + if(a[i]*j<=d) s.insert(a[i]*j); + j++; + } + } + cout< +using namespace std; + +int main(){ + int n; + cin>>n; + double a[n]; + double ans=0; + for(int i=0;i>a[i]; + ans+=a[i]; + } + cout< +using namespace std; + +int main() { + int n,t; + cin>>n>>t; + string a; + cin>>a; + while(t--){ + for(int i=0;i +using namespace std; + +bool areDistinct(int n) +{ + map dis; + int digit; + while (n) + { + digit = n % 10; + if (dis[digit]) + { + return false; + } + dis[digit] = 1; + n /= 10; + } + return true; +} +int main() +{ + int n; + cin >> n; + while (++n) + { + if (areDistinct(n)) + { + cout << n << endl; + break; + } + } + return 0; +} \ No newline at end of file diff --git a/Codeforces/41A_Translation.cpp b/Codeforces/41A_Translation.cpp new file mode 100644 index 0000000..b0286be --- /dev/null +++ b/Codeforces/41A_Translation.cpp @@ -0,0 +1,15 @@ +//code by Nikhil Nagrale +//nikhilnagrale2 on EveryPlatform else nknagrale +#include +using namespace std; + +int main(){ + string a,b; + cin>>a>>b; + for(int i=0;i +using namespace std; + +int main(){ + int w; + cin>>w; + if(w%2==0 && w>2) cout<<"YES"< +using namespace std; + +int main(){ + long long k,n,w; + cin>>k>>n>>w; + long long sum=((w*(w+1))/2)*k; + if(n>=sum) cout<<0< +using namespace std; + +int main() +{ + string a, b; + cin >> a >> b; + string v = ""; + for (int i = 0; i < a.length(); i++) + { + if (a[i] == b[i]) + v += "0"; + else + v += "1"; + } + cout << v << endl; + return 0; +} \ No newline at end of file diff --git a/Codeforces/630A_Again_Twenty_Five!.cpp b/Codeforces/630A_Again_Twenty_Five!.cpp new file mode 100644 index 0000000..0877064 --- /dev/null +++ b/Codeforces/630A_Again_Twenty_Five!.cpp @@ -0,0 +1,11 @@ +//code by Nikhil Nagrale +//nikhilnagrale2 on EveryPlatform +#include +using namespace std; + +int main(){ + + long long n; + + return 0; +} \ No newline at end of file diff --git a/Codeforces/677A_Vanya_and_Fence.cpp b/Codeforces/677A_Vanya_and_Fence.cpp new file mode 100644 index 0000000..a69e8a5 --- /dev/null +++ b/Codeforces/677A_Vanya_and_Fence.cpp @@ -0,0 +1,20 @@ +//code by Nikhil Nagrale +//nikhilnagrale2 on EveryPlatform else nknagrale +#include +using namespace std; + +int main(){ + int n,h; + cin>>n>>h; + vector v; + int temp; + int ans=0; + for(int i=0;i>temp; + if(temp>h) + ans+=2; + else ans++; + } + cout< +using namespace std; + +int main(){ + int n; + cin>>n; + while(n--){ + string s; + cin>>s; + if(s.length()>10){ + string ans; + ans.push_back(s.front()); + ans+=to_string(s.length()-2); + ans+=s.back(); + cout< +using namespace std; + +int main(){ + int n,k; + cin>>n>>k; + while(k--){ + if(n%10==0) n/=10; + else n--; + } + cout< +using namespace std; + +int main(){ + long long n; + cin>>n; + int ans=0; + int a[5]={100,20,10,5,1}; + for(int x:a){ + ans+=n/x; + n%=x; + } + cout<