Submission #70034693


Source Code Expand

n, m = map(int, input().split())
data = [list(map(lambda x:int(x) - 1, input().split())) for _ in range(m)]

ans = m
for bit in range(1 << n):
    ans_i = 0
    for u, v in data:
        if (bit >> u & 1) ^ (bit >> v & 1):
            continue
        else:
            ans_i += 1
    ans = min(ans, ans_i)

print(ans)

Submission Info

Submission Time
Task C - Bipartize
User hyouri
Language Python (PyPy 3.10-v7.3.12)
Score 350
Code Size 333 Byte
Status AC
Exec Time 62 ms
Memory 81564 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 350 / 350
Status
AC × 3
AC × 25
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, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 54 ms 76672 KiB
00_sample_01.txt AC 54 ms 76256 KiB
00_sample_02.txt AC 60 ms 81364 KiB
01_random_03.txt AC 54 ms 76400 KiB
01_random_04.txt AC 59 ms 81368 KiB
01_random_05.txt AC 55 ms 76524 KiB
01_random_06.txt AC 54 ms 76640 KiB
01_random_07.txt AC 58 ms 81316 KiB
01_random_08.txt AC 55 ms 76440 KiB
01_random_09.txt AC 59 ms 81284 KiB
01_random_10.txt AC 59 ms 81476 KiB
01_random_11.txt AC 60 ms 81204 KiB
01_random_12.txt AC 62 ms 81232 KiB
01_random_13.txt AC 59 ms 81564 KiB
01_random_14.txt AC 60 ms 81028 KiB
01_random_15.txt AC 59 ms 80892 KiB
01_random_16.txt AC 60 ms 81016 KiB
01_random_17.txt AC 55 ms 76464 KiB
01_random_18.txt AC 54 ms 76704 KiB
01_random_19.txt AC 55 ms 76316 KiB
01_random_20.txt AC 57 ms 81068 KiB
01_random_21.txt AC 54 ms 76464 KiB
01_random_22.txt AC 55 ms 76316 KiB
01_random_23.txt AC 55 ms 76612 KiB
01_random_24.txt AC 54 ms 76304 KiB