Submission #1606937
Source Code Expand
#include <stdio.h> #include <stdlib.h> typedef struct { int index; int length; } A; int f_cmp(const void *a, const void *b) { return ((A *)b)->length - ((A *)a)->length; } static int n; static A as[100000]; int main(void) { int i; scanf("%d", &n); for (i = 0; i < n; ++i) { as[i].index = i + 1; scanf("%d", &as[i].length); } qsort(as, n, sizeof(A), f_cmp); for (i = 0; i < n; ++i) printf("%d\n", as[i].index); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 背の順 |
User | test20170101 |
Language | C (GCC 5.4.1) |
Score | 100 |
Code Size | 509 Byte |
Status | AC |
Exec Time | 34 ms |
Memory | 1788 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:14:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ ./Main.c:17:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &as[i].length); ^
Judge Result
Set Name | Sample | Subtask1 | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 30 / 30 | 70 / 70 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
Subtask1 | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 2_00.txt, 2_01.txt, 2_02.txt, 2_03.txt, 2_04.txt, 2_05.txt, 2_06.txt, 2_07.txt, 2_08.txt, 2_09.txt, 2_10.txt, 2_11.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 1 ms | 128 KB |
0_01.txt | AC | 1 ms | 128 KB |
0_02.txt | AC | 1 ms | 128 KB |
1_00.txt | AC | 1 ms | 128 KB |
1_01.txt | AC | 1 ms | 128 KB |
1_02.txt | AC | 1 ms | 128 KB |
1_03.txt | AC | 1 ms | 128 KB |
1_04.txt | AC | 1 ms | 128 KB |
1_05.txt | AC | 1 ms | 128 KB |
1_06.txt | AC | 1 ms | 128 KB |
1_07.txt | AC | 1 ms | 128 KB |
1_08.txt | AC | 1 ms | 128 KB |
1_09.txt | AC | 1 ms | 128 KB |
1_10.txt | AC | 1 ms | 128 KB |
1_11.txt | AC | 3 ms | 128 KB |
1_12.txt | AC | 1 ms | 128 KB |
1_13.txt | AC | 1 ms | 128 KB |
1_14.txt | AC | 1 ms | 128 KB |
1_15.txt | AC | 1 ms | 128 KB |
2_00.txt | AC | 24 ms | 1660 KB |
2_01.txt | AC | 23 ms | 1524 KB |
2_02.txt | AC | 26 ms | 1660 KB |
2_03.txt | AC | 25 ms | 1524 KB |
2_04.txt | AC | 34 ms | 1788 KB |
2_05.txt | AC | 34 ms | 1788 KB |
2_06.txt | AC | 34 ms | 1660 KB |
2_07.txt | AC | 34 ms | 1788 KB |
2_08.txt | AC | 26 ms | 1276 KB |
2_09.txt | AC | 32 ms | 1660 KB |
2_10.txt | AC | 10 ms | 636 KB |
2_11.txt | AC | 27 ms | 1404 KB |