Submission #75395660


Source Code Expand

Copy
#include <stdio.h>
int N;
int A[212345];
int meow[212345];
int main(void) {
int i;
int max = 0;
int mofu = 0;
if (scanf("%d", &N) != 1) return 1;
for (i = 0; i < N; i++) {
if (scanf("%d", &A[i]) != 1) return 1;
if (A[i] > max) max = A[i];
}
for (i = 0; i < N; i++) {
meow[max - A[i]]++;
}
for (i = 1; i < max; i++) {
meow[i] += meow[i - 1];
}
for (i = max - 1; i >= 0; i--) {
meow[i] += mofu;
mofu = meow[i] / 10;
meow[i] %= 10;
}
if (mofu > 0) printf("%d", mofu);
for (i = 0; i < max; i++) printf("%d", meow[i]);
putchar('\n');
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <stdio.h>

int N;
int A[212345];

int meow[212345];

int main(void) {
	int i;
	int max = 0;
	int mofu = 0;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
		if (A[i] > max) max = A[i];
	}
	for (i = 0; i < N; i++) {
		meow[max - A[i]]++;
	}
	for (i = 1; i < max; i++) {
		meow[i] += meow[i - 1];
	}
	for (i = max - 1; i >= 0; i--) {
		meow[i] += mofu;
		mofu = meow[i] / 10;
		meow[i] %= 10;
	}
	if (mofu > 0) printf("%d", mofu);
	for (i = 0; i < max; i++) printf("%d", meow[i]);
	putchar('\n');
	return 0;
}

Submission Info

Submission Time
Task D - Many Repunit Sum
User mikecat
Language C23 (GCC 14.2.0)
Score 400
Code Size 606 Byte
Status AC
Exec Time 17 ms
Memory 3464 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 30
Set Name Test Cases
Sample 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt
All 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.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, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 2_1.txt, 2_2.txt, 2_3.txt, 2_4.txt, 2_5.txt, 2_6.txt, 2_7.txt
Case Name Status Exec Time Memory
0_sample_1.txt AC 0 ms 1632 KiB
0_sample_2.txt AC 0 ms 1636 KiB
0_sample_3.txt AC 0 ms 1740 KiB
1_01.txt AC 17 ms 3404 KiB
1_02.txt AC 17 ms 3284 KiB
1_03.txt AC 17 ms 3464 KiB
1_04.txt AC 17 ms 3464 KiB
1_05.txt AC 17 ms 3388 KiB
1_06.txt AC 17 ms 3300 KiB
1_07.txt AC 17 ms 3296 KiB
1_08.txt AC 17 ms 3276 KiB
1_09.txt AC 17 ms 3392 KiB
1_10.txt AC 17 ms 3404 KiB
1_11.txt AC 17 ms 3296 KiB
1_12.txt AC 17 ms 3404 KiB
1_13.txt AC 17 ms 3388 KiB
1_14.txt AC 17 ms 3276 KiB
1_15.txt AC 17 ms 3276 KiB
1_16.txt AC 17 ms 3336 KiB
1_17.txt AC 17 ms 3276 KiB
1_18.txt AC 17 ms 3296 KiB
1_19.txt AC 17 ms 3204 KiB
1_20.txt AC 17 ms 3392 KiB
2_1.txt AC 8 ms 2416 KiB
2_2.txt AC 8 ms 2400 KiB
2_3.txt AC 16 ms 3308 KiB
2_4.txt AC 11 ms 2644 KiB
2_5.txt AC 0 ms 1648 KiB
2_6.txt AC 7 ms 2636 KiB
2_7.txt AC 4 ms 2252 KiB


2026-05-02 (Sat)
07:36:01 +09:00