提出 #66987982
ソースコード 拡げる
#include <stdio.h> #include <stdlib.h> /* 降順 */ int cmp(const void* x, const void* y) { int a = *(const int*)x, b = *(const int*)y; return a > b ? -1 : a < b; } int main(void) { int N, *A; int i; if (scanf("%d", &N) != 1) return 1; A = malloc(sizeof(*A) * N); if (A == NULL) return 2; for (i = 0; i < N; i++) { if (scanf("%d", &A[i]) != 1) { free(A); return 1; } } qsort(A, N, sizeof(*A), cmp); for (i = N; i > 0; i--) { if (A[i - 1] >= i) { printf("%d\n", i); free(A); return 0; } } puts("0"); free(A); return 0; }
提出情報
提出日時 | |
---|---|
問題 | B - Citation |
ユーザ | mikecat |
言語 | C (gcc 12.2.0) |
得点 | 200 |
コード長 | 593 Byte |
結果 | AC |
実行時間 | 1 ms |
メモリ | 1724 KiB |
ジャッジ結果
セット名 | Sample | All | ||||
---|---|---|---|---|---|---|
得点 / 配点 | 0 / 0 | 200 / 200 | ||||
結果 |
|
|
セット名 | テストケース |
---|---|
Sample | 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt, 01_test_25.txt, 01_test_26.txt, 01_test_27.txt, 01_test_28.txt |
ケース名 | 結果 | 実行時間 | メモリ |
---|---|---|---|
00_sample_01.txt | AC | 1 ms | 1568 KiB |
00_sample_02.txt | AC | 1 ms | 1572 KiB |
01_test_01.txt | AC | 1 ms | 1628 KiB |
01_test_02.txt | AC | 1 ms | 1620 KiB |
01_test_03.txt | AC | 1 ms | 1720 KiB |
01_test_04.txt | AC | 1 ms | 1564 KiB |
01_test_05.txt | AC | 1 ms | 1612 KiB |
01_test_06.txt | AC | 1 ms | 1700 KiB |
01_test_07.txt | AC | 1 ms | 1708 KiB |
01_test_08.txt | AC | 1 ms | 1596 KiB |
01_test_09.txt | AC | 1 ms | 1720 KiB |
01_test_10.txt | AC | 1 ms | 1636 KiB |
01_test_11.txt | AC | 1 ms | 1624 KiB |
01_test_12.txt | AC | 1 ms | 1624 KiB |
01_test_13.txt | AC | 1 ms | 1624 KiB |
01_test_14.txt | AC | 1 ms | 1708 KiB |
01_test_15.txt | AC | 1 ms | 1724 KiB |
01_test_16.txt | AC | 1 ms | 1724 KiB |
01_test_17.txt | AC | 1 ms | 1724 KiB |
01_test_18.txt | AC | 1 ms | 1724 KiB |
01_test_19.txt | AC | 1 ms | 1620 KiB |
01_test_20.txt | AC | 1 ms | 1724 KiB |
01_test_21.txt | AC | 0 ms | 1592 KiB |
01_test_22.txt | AC | 0 ms | 1640 KiB |
01_test_23.txt | AC | 1 ms | 1624 KiB |
01_test_24.txt | AC | 1 ms | 1636 KiB |
01_test_25.txt | AC | 1 ms | 1620 KiB |
01_test_26.txt | AC | 0 ms | 1568 KiB |
01_test_27.txt | AC | 1 ms | 1720 KiB |
01_test_28.txt | AC | 1 ms | 1628 KiB |