結果

問題 No.479 頂点は要らない
ユーザー hedwig100hedwig100
提出日時 2020-06-17 14:22:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 467 ms / 1,500 ms
コード長 666 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 41,948 KB
最終ジャッジ日時 2023-09-16 11:26:23
合計ジャッジ時間 7,504 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,800 KB
testcase_01 AC 16 ms
7,752 KB
testcase_02 AC 16 ms
7,764 KB
testcase_03 AC 16 ms
7,864 KB
testcase_04 AC 16 ms
7,804 KB
testcase_05 AC 15 ms
7,700 KB
testcase_06 AC 15 ms
7,772 KB
testcase_07 AC 15 ms
7,720 KB
testcase_08 AC 15 ms
7,780 KB
testcase_09 AC 15 ms
7,808 KB
testcase_10 AC 16 ms
7,864 KB
testcase_11 AC 16 ms
7,764 KB
testcase_12 AC 15 ms
7,800 KB
testcase_13 AC 15 ms
7,800 KB
testcase_14 AC 15 ms
7,804 KB
testcase_15 AC 15 ms
7,752 KB
testcase_16 AC 15 ms
7,860 KB
testcase_17 AC 15 ms
7,756 KB
testcase_18 AC 15 ms
7,764 KB
testcase_19 AC 19 ms
8,260 KB
testcase_20 AC 19 ms
8,204 KB
testcase_21 AC 18 ms
8,172 KB
testcase_22 AC 19 ms
8,204 KB
testcase_23 AC 19 ms
8,204 KB
testcase_24 AC 19 ms
8,176 KB
testcase_25 AC 18 ms
8,216 KB
testcase_26 AC 467 ms
41,252 KB
testcase_27 AC 461 ms
41,136 KB
testcase_28 AC 404 ms
41,948 KB
testcase_29 AC 333 ms
36,524 KB
testcase_30 AC 337 ms
36,524 KB
testcase_31 AC 334 ms
36,532 KB
testcase_32 AC 336 ms
36,556 KB
testcase_33 AC 357 ms
32,972 KB
testcase_34 AC 395 ms
34,792 KB
testcase_35 AC 375 ms
33,388 KB
testcase_36 AC 237 ms
24,492 KB
testcase_37 AC 376 ms
34,636 KB
testcase_38 AC 320 ms
30,612 KB
testcase_39 AC 226 ms
24,544 KB
testcase_40 AC 272 ms
28,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    N,M = map(int,input().split())
    G = [[] for _ in range(N)]
    buy = [1] * M
    for i in range(M):
        a,b = map(int,input().split())
        G[a].append((b,i))
        G[b].append((a,i))
    
    ans = 0
    for i in range(N - 1,-1,-1):
        flag = False
        for e,j in G[i]:
            if buy[j] == 0:
                flag = True
                break
            else:
                buy[j] = 0
        if flag:
            ans ^= 1<<i
            for e,j in G[i]:
                buy[j] = 1
    print(bin(ans)[2:])
if __name__ == '__main__':
    main()
0