Codeforces 584A. Olesya and Rodion Solution

 Solution in C++:

 ///La ilaha illellahu muhammadur rasulullah

///******Bismillahir-Rahmanir-Rahim******///

///AH Tonmoy

///Department of CSE,23rd batch

    ///Islamic University,Bangladesh

    1. #include <bits/stdc++.h>
    2. using namespace std;
    3. int main()
    4. {
    5. int n,t,i;
    6. cin>>n>>t;
    7. if((n==1)&&(t==10))
    8. {
    9. cout<<"-1"<<endl;
    10. return 0;
    11. }
    12. else if(t==10)
    13. {
    14. cout<<t;
    15. for(i=2; i<n; i++)
    16. cout<<"0";
    17. }
    18. else
    19. {
    20. cout<<t;
    21. for(i=2; i<=n; i++)
    22. cout<<"0";
    23. }
    24. cout<<endl;
    25. }


    No comments

    Most View Post

    Recent post

    Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

      Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

    Powered by Blogger.