Submission #65966033


Source Code Expand

Copy
#include <stdio.h>
int main(void) {
int N;
int i;
int ans = 0;
if (scanf("%d", &N) != 1) return 1;
for (i = 1; i <= N; i++) {
int A;
if (scanf("%d", &A) != 1) return 1;
if (i % 2 != 0) ans += A;
}
printf("%d\n", ans);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <stdio.h>

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

Submission Info

Submission Time
Task A - Odd Position Sum
User mikecat
Language C (gcc 12.2.0)
Score 100
Code Size 260 Byte
Status AC
Exec Time 1 ms
Memory 1724 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 13
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.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
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 1712 KB
00_sample_01.txt AC 0 ms 1612 KB
00_sample_02.txt AC 0 ms 1712 KB
01_test_00.txt AC 0 ms 1620 KB
01_test_01.txt AC 0 ms 1624 KB
01_test_02.txt AC 0 ms 1712 KB
01_test_03.txt AC 1 ms 1616 KB
01_test_04.txt AC 0 ms 1704 KB
01_test_05.txt AC 0 ms 1624 KB
01_test_06.txt AC 0 ms 1620 KB
01_test_07.txt AC 1 ms 1624 KB
01_test_08.txt AC 1 ms 1712 KB
01_test_09.txt AC 0 ms 1724 KB


2025-05-19 (Mon)
07:36:40 +09:00