結果

問題 No.1744 Selfish Spies 1 (à la Princess' Perfectionism)
コンテスト
ユーザー gew1fw
提出日時 2025-06-12 21:36:57
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 622 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 258 ms
コンパイル使用メモリ 95,836 KB
実行使用メモリ 115,728 KB
最終ジャッジ日時 2026-07-12 03:56:50
合計ジャッジ時間 5,995 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def main():
    import sys
    input = sys.stdin.read().split()
    idx = 0
    N = int(input[idx])
    idx += 1
    M = int(input[idx])
    idx += 1
    L = int(input[idx])
    idx += 1

    count_u = [0] * (N + 1)
    count_v = [0] * (M + 1)

    edges = []
    for _ in range(L):
        s = int(input[idx])
        idx += 1
        t = int(input[idx])
        idx += 1
        edges.append((s, t))
        count_u[s] += 1
        count_v[t] += 1

    for s, t in edges:
        if count_u[s] == 1 or count_v[t] == 1:
            print("No")
        else:
            print("Yes")

if __name__ == "__main__":
    main()
0