Submission #11131424


Source Code Expand

Copy
import itertools

N, M = map(int, input().split())
balls = [0] * N + [1] * M
answer = sum((x + y) % 2 == 0 for x, y in itertools.combinations(balls, 2))
print(answer)

Submission Info

Submission Time
Task A - The Number of Even Pairs
User maspy
Language Python3 (3.4.3)
Score 100
Code Size 173 Byte
Status
Exec Time 20 ms
Memory 3060 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt
All 100 / 100 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, hand.txt, max.txt, rand_01.txt, rand_02.txt, rand_03.txt, rand_04.txt, rand_05.txt
Case Name Status Exec Time Memory
00_sample_01.txt 17 ms 2940 KB
00_sample_02.txt 17 ms 2940 KB
00_sample_03.txt 17 ms 3060 KB
00_sample_04.txt 17 ms 3060 KB
00_sample_05.txt 17 ms 2940 KB
hand.txt 17 ms 3060 KB
max.txt 20 ms 3060 KB
rand_01.txt 19 ms 3060 KB
rand_02.txt 18 ms 3060 KB
rand_03.txt 18 ms 2940 KB
rand_04.txt 17 ms 3060 KB
rand_05.txt 17 ms 3060 KB