Submission #1585575
Source Code Expand
#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int n, i, j; char **p; scanf("%d", &n); p = (char **)calloc(n, sizeof(char *)); for(i = 0; i < n; i++) { char temp[51]; int j = 0; scanf("%s", temp); p[i] = (char *)malloc(strlen(temp) + 1); while(temp[j]) p[i][j] = temp[j++]; p[i][j] = '\0'; } for(i = 0; i < n - 1; i++) for(j = n - 1; j > i; j--) if(strcmp(p[j - 1], p[j]) > 0) { char *t = p[j - 1]; p[j - 1] = p[j]; p[j] = t; } printf("%s%s\n", p[0], p[1]); for(i = 0; i < n; i++) free(p[i]); free(p); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - パスワード |
User | mafun |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 645 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:10:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ ./Main.c:19:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%s", temp); ^
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 100 | ||||
Status |
|
Set Name | Test Cases |
---|---|
All | input_0.txt, input_1.txt, input_10.txt, input_11.txt, input_12.txt, input_13.txt, input_14.txt, input_15.txt, input_16.txt, input_17.txt, input_18.txt, input_19.txt, input_2.txt, input_20.txt, input_21.txt, input_22.txt, input_23.txt, input_3.txt, input_4.txt, input_5.txt, input_6.txt, input_7.txt, input_8.txt, input_9.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
input_0.txt | AC | 1 ms | 128 KB |
input_1.txt | AC | 1 ms | 128 KB |
input_10.txt | AC | 1 ms | 128 KB |
input_11.txt | AC | 1 ms | 128 KB |
input_12.txt | AC | 1 ms | 128 KB |
input_13.txt | AC | 1 ms | 128 KB |
input_14.txt | AC | 1 ms | 128 KB |
input_15.txt | AC | 1 ms | 128 KB |
input_16.txt | AC | 1 ms | 128 KB |
input_17.txt | AC | 1 ms | 128 KB |
input_18.txt | AC | 1 ms | 128 KB |
input_19.txt | AC | 1 ms | 128 KB |
input_2.txt | AC | 1 ms | 128 KB |
input_20.txt | AC | 1 ms | 128 KB |
input_21.txt | WA | 1 ms | 128 KB |
input_22.txt | AC | 1 ms | 128 KB |
input_23.txt | AC | 1 ms | 128 KB |
input_3.txt | AC | 1 ms | 128 KB |
input_4.txt | AC | 1 ms | 128 KB |
input_5.txt | AC | 1 ms | 128 KB |
input_6.txt | AC | 1 ms | 128 KB |
input_7.txt | AC | 1 ms | 128 KB |
input_8.txt | AC | 1 ms | 128 KB |
input_9.txt | WA | 1 ms | 128 KB |