Giter Site home page Giter Site logo

201907-inu's Introduction

Hi there πŸ‘‹

zoops's github stats

201907-inu's People

Contributors

zoops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

201907-inu's Issues

κ°•μ‚¬λ‹˜, μ•Œκ³ λ¦¬μ¦˜ λ“£λŠ” ν•™μƒμž…λ‹ˆλ‹€. κ°€μž₯ 큰 수 문제 ν’€λ‹€ μ•ˆν’€λ €μ„œ 질문 μ˜¬λ €λ΄…λ‹ˆλ‹€..

#include <string>
#include <vector>
#include <algorithm>

using namespace std;

bool desc(string a, string b) {
	int a_size = a.length();
	char a_init = a[0] - '\0';
	char b_init = b[0] - '\0';
	int b_size = b.length();
	if(a_size == b_size)
		return a > b;
	else if (a_size > b_size) {
		for (int i = 0; i < b_size; i++) {
			if (a[i] == b[i])
				continue;
			return a > b;
		}
        int size = b_size;
		if (a[size] > a[size - b_size])
			return a > b;
		else if (a[size] < a[size - b_size])
			return a < b;
		else {
            while(++size < a_size){
                if (a[size] == a[size-b_size])continue;
				else if (a[size] > a[size-b_size]) return a > b;
				else return a < b;
            }
            for(int i=0;i<b_size;i++, size++){
                if (b[i] == a[size - b_size])continue;
				else if (b[i] > a[size - b_size]) return a > b;
				else return a < b;
            
            }
		}
	}
	else {
		for (int i = 0; i < a_size; i++) {
			if (a[i] == b[i])
				continue;
			return a > b;
		}
        int size = a_size;
		if (b[size] > b[size-a_size])
			return a > b;
		else if (b[size] < b[size-a_size])
			return a < b;
        else {
            while(++size < b_size){
                if (b[size] == b[size-b_size])continue;
				else if (b[size] > b[size-b_size]) return a > b;
				else return a < b;
            }
            for(int i=0;i<a_size;i++, size++){
                if (a[i] == b[size - a_size])continue;
				else if (a[i] > b[size - a_size]) return a > b;
				else return a < b;
            }
		}
	}
}

string solution(vector<int> numbers) {
	vector<string> str_numbers;
	string answer = "";

	for (auto iter = numbers.begin(); iter < numbers.end(); iter++) {
		string bmp = to_string(*iter);
		str_numbers.push_back(bmp);
	}
	sort(str_numbers.begin(), str_numbers.end(), desc);
	for (auto iter = str_numbers.begin(); iter < str_numbers.end(); iter++) {
		answer += *iter;
	}
	if (answer[0] == '0')answer = "0";
	return answer;
}

μΆ”κ°€ν•œ ν…ŒμŠ€νŠΈμΌ€μ΄μŠ€
[40,403 ]
[40,405]
[40,404]
[12,121]
[2,22,223]
[21,212]
[41,415]
[2,22 ]
[70,0,0,0]
[0,0,0,0]
[0,0,0,1000]
[12,1213]

ν…ŒμŠ€νŠΈμΌ€μ΄μŠ€#1 ~ #6이 계속 μ‹€νŒ¨ν•΄μ„œ μ§ˆλ¬Έν•˜κΈ°μ— μžˆλŠ” ν…ŒμŠ€νŠΈμΌ€μ΄μŠ€λ₯Ό λ‹€ ν†΅κ³Όν–ˆλŠ”λ°λ„ μ‹€νŒ¨ν•΄μ„œ μ§ˆλ¬Έμ˜¬λ €λ΄…λ‹ˆλ‹€

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.