Submission #1482904


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

#define FOR(i,l,r) for(int i = int(l);i < int(r);i++)
template<typename T> bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; }
template<typename T> bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; }
typedef long long ll;

int N,K;
vector<string> S;

bool comp(const string& a,const string& b)
{
	return a + b > b + a;
}

int main()
{
	cin >> N >> K;
	S.assign(N,"");
	FOR(i,0,N){
		cin >> S [i];
	}
	sort(S.begin(),S.end(),comp);

	string ans = accumulate(S.begin(),S.end(),string(""));
	cout << ans << endl;

	return 0;
}

Submission Info

Submission Time
Task B - String Sorting
User gigime
Language C++14 (GCC 5.4.1)
Score 100
Code Size 633 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 43
Set Name Test Cases
All 00_sample_1, 00_sample_2, 10_max_06, 10_max_07, 10_max_08, 10_max_09, 10_max_10, 10_min_00, 10_min_01, 10_min_02, 10_min_03, 10_min_04, 10_min_05, 10_rand_11, 10_rand_12, 10_rand_13, 10_rand_14, 10_rand_15, 10_rand_16, 10_rand_17, 10_rand_18, 10_rand_19, 10_rand_20, 10_rand_21, 10_rand_22, 10_rand_23, 10_rand_24, 10_rand_25, 10_rand_26, 10_rand_27, 10_rand_28, 10_rand_29, 10_rand_30, 10_rand_31, 10_rand_32, 10_rand_33, 10_rand_34, 10_rand_35, 10_rand_36, 10_rand_37, 10_rand_38, 10_rand_39, 10_rand_40
Case Name Status Exec Time Memory
00_sample_1 AC 1 ms 256 KB
00_sample_2 AC 1 ms 256 KB
10_max_06 AC 1 ms 256 KB
10_max_07 AC 1 ms 256 KB
10_max_08 AC 1 ms 256 KB
10_max_09 AC 1 ms 256 KB
10_max_10 AC 1 ms 256 KB
10_min_00 AC 1 ms 256 KB
10_min_01 AC 1 ms 256 KB
10_min_02 AC 1 ms 256 KB
10_min_03 AC 1 ms 256 KB
10_min_04 AC 1 ms 256 KB
10_min_05 AC 1 ms 256 KB
10_rand_11 AC 1 ms 256 KB
10_rand_12 AC 1 ms 256 KB
10_rand_13 AC 1 ms 256 KB
10_rand_14 AC 1 ms 256 KB
10_rand_15 AC 1 ms 256 KB
10_rand_16 AC 1 ms 256 KB
10_rand_17 AC 1 ms 256 KB
10_rand_18 AC 1 ms 256 KB
10_rand_19 AC 1 ms 256 KB
10_rand_20 AC 1 ms 256 KB
10_rand_21 AC 1 ms 256 KB
10_rand_22 AC 1 ms 256 KB
10_rand_23 AC 1 ms 256 KB
10_rand_24 AC 1 ms 256 KB
10_rand_25 AC 1 ms 256 KB
10_rand_26 AC 1 ms 256 KB
10_rand_27 AC 1 ms 256 KB
10_rand_28 AC 1 ms 256 KB
10_rand_29 AC 1 ms 256 KB
10_rand_30 AC 1 ms 256 KB
10_rand_31 AC 1 ms 256 KB
10_rand_32 AC 1 ms 256 KB
10_rand_33 AC 1 ms 256 KB
10_rand_34 AC 1 ms 256 KB
10_rand_35 AC 1 ms 256 KB
10_rand_36 AC 1 ms 256 KB
10_rand_37 AC 1 ms 256 KB
10_rand_38 AC 1 ms 256 KB
10_rand_39 AC 1 ms 256 KB
10_rand_40 AC 1 ms 256 KB