Submission #63939091


Source Code Expand

Copy
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int N;
char S[64][64];
size_t len[64];
int idx[64];
int cmp(const void* x, const void* y) {
size_t a = len[*(const int*)x], b = len[*(const int*)y];
return a < b ? -1 : a > b;
}
int main(void) {
int i;
if (scanf("%d", &N) != 1) return 1;
for (i = 0; i < N; i++) {
if (scanf("%63s", S[i]) != 1) return 1;
len[i] = strlen(S[i]);
idx[i] = i;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int N;
char S[64][64];
size_t len[64];
int idx[64];

int cmp(const void* x, const void* y) {
	size_t a = len[*(const int*)x], b = len[*(const int*)y];
	return a < b ? -1 : a > b;
}

int main(void) {
	int i;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%63s", S[i]) != 1) return 1;
		len[i] = strlen(S[i]);
		idx[i] = i;
	}
	qsort(idx, N, sizeof(*idx), cmp);
	for (i = 0; i < N; i++) {
		fputs(S[idx[i]], stdout);
	}
	putchar('\n');
	return 0;
}

Submission Info

Submission Time
Task B - cat
User mikecat
Language C (gcc 12.2.0)
Score 200
Code Size 566 Byte
Status AC
Exec Time 0 ms
Memory 1660 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 15
Set Name Test Cases
Sample sample00.txt, sample01.txt
All sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt
Case Name Status Exec Time Memory
sample00.txt AC 0 ms 1644 KB
sample01.txt AC 0 ms 1616 KB
testcase00.txt AC 0 ms 1644 KB
testcase01.txt AC 0 ms 1628 KB
testcase02.txt AC 0 ms 1652 KB
testcase03.txt AC 0 ms 1652 KB
testcase04.txt AC 0 ms 1624 KB
testcase05.txt AC 0 ms 1584 KB
testcase06.txt AC 0 ms 1660 KB
testcase07.txt AC 0 ms 1536 KB
testcase08.txt AC 0 ms 1608 KB
testcase09.txt AC 0 ms 1532 KB
testcase10.txt AC 0 ms 1620 KB
testcase11.txt AC 0 ms 1616 KB
testcase12.txt AC 0 ms 1604 KB


2025-03-19 (Wed)
01:09:10 +09:00