Submission #64483484


Source Code Expand

#include <stdio.h>

int N;
int A[312345];

int cnt[2][312345];

int main(void) {
	int i;
	int cur = 0, ans = 0;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
		if (cnt[0][A[i]]++ == 0) cur++;
	}
	for (i = 0; i < N - 1; i++) {
		if (--cnt[0][A[i]] == 0) cur--;
		if (cnt[1][A[i]]++ == 0) cur++;
		if (ans < cur) ans = cur;
	}
	printf("%d\n", ans);
	return 0;
}

Submission Info

Submission Time
Task C - Variety Split Easy
User mikecat
Language C (gcc 12.2.0)
Score 350
Code Size 442 Byte
Status AC
Exec Time 34 ms
Memory 5248 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 350 / 350
Status
AC × 2
AC × 38
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_test_00.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, 01_test_29.txt, 01_test_30.txt, 01_test_31.txt, 01_test_32.txt, 01_test_33.txt, 01_test_34.txt, 01_test_35.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 1656 KiB
00_sample_01.txt AC 1 ms 1736 KiB
01_test_00.txt AC 1 ms 1588 KiB
01_test_01.txt AC 1 ms 1724 KiB
01_test_02.txt AC 1 ms 1644 KiB
01_test_03.txt AC 1 ms 1724 KiB
01_test_04.txt AC 1 ms 1604 KiB
01_test_05.txt AC 7 ms 2700 KiB
01_test_06.txt AC 31 ms 5104 KiB
01_test_07.txt AC 10 ms 2832 KiB
01_test_08.txt AC 31 ms 5228 KiB
01_test_09.txt AC 27 ms 4852 KiB
01_test_10.txt AC 31 ms 5144 KiB
01_test_11.txt AC 7 ms 2636 KiB
01_test_12.txt AC 30 ms 5236 KiB
01_test_13.txt AC 4 ms 2176 KiB
01_test_14.txt AC 33 ms 5148 KiB
01_test_15.txt AC 32 ms 5096 KiB
01_test_16.txt AC 31 ms 5244 KiB
01_test_17.txt AC 32 ms 5148 KiB
01_test_18.txt AC 34 ms 5248 KiB
01_test_19.txt AC 32 ms 5168 KiB
01_test_20.txt AC 15 ms 2816 KiB
01_test_21.txt AC 20 ms 2808 KiB
01_test_22.txt AC 19 ms 2756 KiB
01_test_23.txt AC 19 ms 2812 KiB
01_test_24.txt AC 19 ms 2924 KiB
01_test_25.txt AC 20 ms 5120 KiB
01_test_26.txt AC 31 ms 5248 KiB
01_test_27.txt AC 1 ms 1740 KiB
01_test_28.txt AC 0 ms 1576 KiB
01_test_29.txt AC 21 ms 5144 KiB
01_test_30.txt AC 18 ms 3132 KiB
01_test_31.txt AC 17 ms 2892 KiB
01_test_32.txt AC 20 ms 5248 KiB
01_test_33.txt AC 22 ms 5248 KiB
01_test_34.txt AC 20 ms 5104 KiB
01_test_35.txt AC 21 ms 5168 KiB