201907-inu's Introduction
201907-inu's People
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.