Ek Code Chef challenge- Welcome Developers, Hackers & Noobs

owlX

Well-known member
  • Jul 13, 2014
    1,321
    400
    83
    /usr/bin
    Welcome to Ek Code Chef Challenge
    <Ek 3C/>


    show your problem solving skills.

    X48adYnt_400x400.jpeg


    මේ ටිකේ කට්ටියගේ කිසිම ගතියක් නෑනේ. ඔන්න කට්ටිය මරා ගන්න වැඩක් එහෙනම්.

    අපි මෙතන දාන problem එක solve කරලා දාන්න ඕන.
    මේ නීති හා උපදෙස් වලට අනුව විසදිය යුතුයි.


    [+] Code එක Java, C++, C# හෝ Python (>3.x.x) වලින් තිබිය යුතුයි.
    [+] Code එක තමා විසින්ම විසදිය යුතු අතර අන්තර්ජාලයේ පිහිට නොපැතිය යුතුයි.
    [+]Code එකේ Syntax මෙන්ම කුඩා Symantec Errors එකක් වුවද පැවතිය නොහැක.
    [+]පලමුවෙන්ම නිවැරදිව ‍කෝඩ් එක ඉදිරිපත් කරන පුද්ගලයන්ට සියල්ලන්ගේම Rep හිමි වේ.
    [+]නිවැරදි Code එක පලවෙන තුරු වෙනත් අයකු විසින් වැරද්ද පෙන්වා දීම කල නොයුතුයි.
    [+] Code එක PHP tag තුල පල කල යුතුයි.
    [+] Output එක නිවැරදි ලෙස පෙනුනද නිවැරදි නොවිය හැක.
    [+] සියළුම input හා output, console එකක් භාවිතයෙන් සිදු කල යුතුය. (No GUI)
    [+] එමෙන්ම IDE භාවිතා නොකරන ලෙසද ඉල්ලා සිටිමි :dull:


    ඉදිරියේදී Code Simulator එකක් මගින් ජයග්‍රාහකයා තේරීමට සැලසුමක් ඇත

    A good programmer is someone who always looks both ways before crossing a one-way street.

    <Happy Coding Guys/>


    < Send Thread Link Your Friends Who Loves to Code />

     
    Last edited:

    owlX

    Well-known member
  • Jul 13, 2014
    1,321
    400
    83
    /usr/bin
    #01 Challenge

    Given the list of numbers, you are to sort them in non decreasing order.
    Input

    I – the number of numbers in list, then I lines follow [I <= 100,000].

    Each line contains one integer: N [0 <= N <= 100,000]

    Output

    Output given numbers in non decreasing order.
    Example

    Input:

    8
    5
    3
    6
    7
    5
    3
    1
    5

    Output:
    1
    3
    3
    5
    5
    5
    6
    7
     
    Last edited:

    owlX

    Well-known member
  • Jul 13, 2014
    1,321
    400
    83
    /usr/bin
    කෝ ඉතිං ප්‍රශ්නෙත් දාපන්කෝ.
    දැම්මා මචෝ.. දාන්න කලින් උඹ පැනලනේ :P
    mama nam danne na
    බෑයි කියලා බෑයි කියලා බෑ.. PHP වලින් සෑහෙන්න බොන්න වෙයි බං simulate කරන්න ගියාම ඉස්සරහට නැත්තම් දාන්න තිබ්බා Python ට්‍රයි කරපංකෝ :angry:
     

    Agent 007

    Well-known member
  • Jan 19, 2012
    2,552
    259
    83
    Gampaha
    #01 Challenge

    Given the list of numbers, you are to sort them in non decreasing order.
    Input

    I – the number of numbers in list, then I lines follow [I <= 100,000].

    Each line contains one integer: N [0 <= N <= 100,000]

    Output

    Output given numbers in non decreasing order.
    Example

    Input:

    8
    5
    3
    6
    7
    5
    3
    1
    5

    Output:
    1
    3
    3
    5
    5
    5
    6
    7

    හුටා තේරෙන්නෙන් නැහැ. output එකේ 8 මොකෝ කලේ උබ. :(
     

    IDG

    Well-known member
  • Aug 3, 2012
    14,166
    3,146
    113
    34
    වාහන ගොඩේ
    නියම වැඩේ මචන් මේක නම් මේ දවස් ටිකේ exam ඉවර උන ගමන් එන්නම් මරාගන්න
     

    owlX

    Well-known member
  • Jul 13, 2014
    1,321
    400
    83
    /usr/bin
    හුටා තේරෙන්නෙන් නැහැ. output එකේ 8 මොකෝ කලේ උබ. :(

    හෙහේ කියවපං මචෝ 4 5ස් පාරක් ‍තේරෙයි එතකොට.. :yes::yes:
    කව්රු හරි solve කරපු ගමන් මුල ඉදන් කියන්නම් :yes: :nerd:
    පොඩි case එකක තියෙන්නේ හොදට ගනන් කරලා පලබං පේලි කීයද කියලා :rolleyes::rofl:

    නියම වැඩේ මචන් මේක නම් මේ දවස් ටිකේ exam ඉවර උන ගමන් එන්නම් මරාගන්න
    හල මචෝ :yes:
     
    Last edited:

    owlX

    Well-known member
  • Jul 13, 2014
    1,321
    400
    83
    /usr/bin
    Python 2.7 :P

    PHP:
    a = raw_input("Please enter the numbers seperated by spaces: ")
    numbers = map(int, a.split())
    sorted_num = sorted(numbers)
    for i in sorted_num:
        print i

    athal ekata kare hode :rofl:

    Wrong Code :P

    PHP th dapan machan..meke godak un inne php.java un innawa..eth python un adui :yes:

    එල මචෝ ඉස්සරහට දාමු. හැබැයි output input දෙන විදිය වෙනස් කරන්න වෙයි php වලට වෙනම :nerd:
     
    Last edited:

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,653
    113
    කැළෑ පොජ්ජේ
    Wrong Code :P



    එල මචෝ ඉස්සරහට දාමු. හැබැයි output input දෙන විදිය වෙනස් කරන්න වෙයි php වලට වෙනම :nerd:

    Wrong kiwwata hariyanne na :P kiyapan mokakda wrong kiyala :rofl: mage code eke syntax awulakda...natttam uba kiyapu eka nemeida mama karala thiyenne..ehema hint ekak one..meka api me patan gatta witharane..ubata sup ekak widihata code ekak liyala damme :P

    Php walath command line puluwanne :yes: habai katta ithin :no:
     

    owlX

    Well-known member
  • Jul 13, 2014
    1,321
    400
    83
    /usr/bin
    Wrong kiwwata hariyanne na :P kiyapan mokakda wrong kiyala :rofl: mage code eke syntax awulakda...natttam uba kiyapu eka nemeida mama karala thiyenne..ehema hint ekak one..meka api me patan gatta witharane..ubata sup ekak widihata code ekak liyala damme :P

    Php walath command line puluwanne :yes: habai katta ithin :no:

    Input දෙන්න ඕන තියෙන විදියට බං.. උඹ කෑල්ලක් අත ඇරලා කරලා තියෙන්නේ..
    Input must be:

    3
    4
    12
    1

    output :
    1
    4
    12

    එල PHP දාමු මචං ඊලග එකේ ඉදං.. මට නෙමේනේ Rep හම්බෙන්නේ උඹලටනේ :P
     

    Suvin1122

    Well-known member
  • Feb 28, 2009
    12,517
    1,018
    113
    Elakiri Server....
    #01 Challenge

    Given the list of numbers, you are to sort them in non decreasing order.
    Input

    I – the number of numbers in list, then I lines follow [I <= 100,000].

    Each line contains one integer: N [0 <= N <= 100,000]

    Output

    Output given numbers in non decreasing order.
    Example

    Input:

    8
    5
    3
    6
    7
    5
    3
    1
    5

    Output:
    1
    3
    3
    5
    5
    5
    6
    7

    arrays.sort().. :P