Submission #64641530
Source Code Expand
Copy
#include <stdio.h>#include <stdlib.h>int N;int A[312345];struct meow {int num;int hito;};/* num の降順 */int cmp(const void* x, const void* y) {struct meow a = *(const struct meow*)x, b = *(const struct meow*)y;return a.num > b.num ? -1 : a.num < b.num;}struct meow nyan[312345];int main(void) {int i;
#include <stdio.h>
#include <stdlib.h>
int N;
int A[312345];
struct meow {
int num;
int hito;
};
/* num の降順 */
int cmp(const void* x, const void* y) {
struct meow a = *(const struct meow*)x, b = *(const struct meow*)y;
return a.num > b.num ? -1 : a.num < b.num;
}
struct meow nyan[312345];
int main(void) {
int i;
if (scanf("%d", &N) != 1) return 1;
for (i = 0; i < N; i++) {
if (scanf("%d", &A[i]) != 1) return 1;
nyan[i].num = A[i];
nyan[i].hito = i + 1;
}
qsort(nyan, N, sizeof(*nyan), cmp);
for (i = 0; i < N; i++) {
if (nyan[i].num != nyan[i + 1].num && (i == 0 || nyan[i].num != nyan[i - 1].num)) {
printf("%d\n", nyan[i].hito);
return 0;
}
}
puts("-1");
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Uniqueness |
| User | mikecat |
| Language | C (gcc 12.2.0) |
| Score | 300 |
| Code Size | 750 Byte |
| Status | AC |
| Exec Time | 67 ms |
| Memory | 7392 KB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| hand_01.txt | AC | 1 ms | 1640 KB |
| hand_02.txt | AC | 1 ms | 1576 KB |
| hand_03.txt | AC | 0 ms | 1588 KB |
| random_01.txt | AC | 67 ms | 7268 KB |
| random_02.txt | AC | 26 ms | 3964 KB |
| random_03.txt | AC | 64 ms | 6928 KB |
| random_04.txt | AC | 47 ms | 5680 KB |
| random_05.txt | AC | 65 ms | 7328 KB |
| random_06.txt | AC | 67 ms | 7392 KB |
| random_07.txt | AC | 50 ms | 5724 KB |
| random_08.txt | AC | 51 ms | 6048 KB |
| random_09.txt | AC | 30 ms | 6248 KB |
| random_10.txt | AC | 37 ms | 7308 KB |
| random_11.txt | AC | 37 ms | 7352 KB |
| random_12.txt | AC | 35 ms | 6252 KB |
| random_13.txt | AC | 35 ms | 5876 KB |
| random_14.txt | AC | 36 ms | 7344 KB |
| random_15.txt | AC | 36 ms | 7392 KB |
| random_16.txt | AC | 18 ms | 3108 KB |
| random_17.txt | AC | 4 ms | 2096 KB |
| random_18.txt | AC | 44 ms | 5452 KB |
| random_19.txt | AC | 33 ms | 4428 KB |
| random_20.txt | AC | 25 ms | 3600 KB |
| random_21.txt | AC | 1 ms | 1644 KB |
| random_22.txt | AC | 34 ms | 4452 KB |
| random_23.txt | AC | 15 ms | 2864 KB |
| sample_01.txt | AC | 0 ms | 1724 KB |
| sample_02.txt | AC | 0 ms | 1552 KB |