Submission #66672034


Source Code Expand

Copy
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int X, Y;
int i, j, cnt = 0;
if (scanf("%d%d", &X, &Y) != 2) return 1;
for (i = 1; i <= 6; i++) {
for (j = 1; j <= 6; j++) {
cnt += i + j >= X || abs(i - j) >= Y;
}
}
printf("%.20f\n", cnt / 36.0);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int X, Y;
	int i, j, cnt = 0;
	if (scanf("%d%d", &X, &Y) != 2) return 1;
	for (i = 1; i <= 6; i++) {
		for (j = 1; j <= 6; j++) {
			cnt += i + j >= X || abs(i - j) >= Y;
		}
	}
	printf("%.20f\n", cnt / 36.0);
	return 0;
}

Submission Info

Submission Time
Task B - P(X or Y)
User mikecat
Language C (gcc 12.2.0)
Score 250
Code Size 296 Byte
Status AC
Exec Time 0 ms
Memory 1740 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 3
AC × 17
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_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 0 ms 1628 KiB
00_sample_01.txt AC 0 ms 1732 KiB
00_sample_02.txt AC 0 ms 1676 KiB
01_random_03.txt AC 0 ms 1728 KiB
01_random_04.txt AC 0 ms 1720 KiB
01_random_05.txt AC 0 ms 1640 KiB
01_random_06.txt AC 0 ms 1624 KiB
01_random_07.txt AC 0 ms 1632 KiB
01_random_08.txt AC 0 ms 1636 KiB
01_random_09.txt AC 0 ms 1704 KiB
01_random_10.txt AC 0 ms 1676 KiB
01_random_11.txt AC 0 ms 1564 KiB
01_random_12.txt AC 0 ms 1724 KiB
01_random_13.txt AC 0 ms 1740 KiB
01_random_14.txt AC 0 ms 1728 KiB
01_random_15.txt AC 0 ms 1612 KiB
01_random_16.txt AC 0 ms 1712 KiB


2025-06-12 (Thu)
06:47:59 +09:00