Code Monkey home page Code Monkey logo

boj-16496's Introduction

boj-16496

백준 16496을 러스트(rust)로 푼 코드

use std::io::stdin;
fn main(){
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();

    s = String::new();
    stdin().read_line(&mut s).unwrap();
    let mut res = s.split_whitespace().collect::<Vec<&str>>();
    res.sort_by_key(|x|x.len());
    let len = res[res.len()-1].len();
    let repeat = (len as f32 / res[0].len() as f32).round() as usize + 1;

    res.sort_by_key(|x|{(x.repeat(repeat*2)[..len*2]).parse::<u128>().unwrap()});
    res.reverse();
    let mut end = String::new();
    for s in res{
        end.push_str(s);
    }
    if end.replace("0", "") == ""{
        print!("0")
    }else{
        print!("{end}")
    }
}

boj-16496's People

Contributors

p-asta avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.