結果

問題 No.1744 Selfish Spies 1 (à la Princess' Perfectionism)
ユーザー dn6049949dn6049949
提出日時 2021-11-14 21:27:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 835 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 81,960 KB
実行使用メモリ 86,052 KB
最終ジャッジ日時 2024-05-07 13:23:00
合計ジャッジ時間 3,854 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
54,756 KB
testcase_01 AC 40 ms
55,384 KB
testcase_02 AC 42 ms
56,524 KB
testcase_03 AC 41 ms
55,116 KB
testcase_04 AC 42 ms
56,080 KB
testcase_05 WA -
testcase_06 AC 39 ms
55,420 KB
testcase_07 WA -
testcase_08 AC 42 ms
55,600 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 42 ms
57,268 KB
testcase_12 WA -
testcase_13 AC 44 ms
57,196 KB
testcase_14 WA -
testcase_15 AC 51 ms
65,664 KB
testcase_16 AC 60 ms
70,660 KB
testcase_17 WA -
testcase_18 AC 63 ms
72,256 KB
testcase_19 WA -
testcase_20 AC 40 ms
55,556 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 43 ms
56,468 KB
testcase_24 WA -
testcase_25 AC 61 ms
71,332 KB
testcase_26 AC 60 ms
71,808 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 67 ms
77,320 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def main():
    n,m,l = LI()
    st = LIR(l)
    fs = [0]*(n+1)
    ft = [0]*(m+1)
    for s,t in st:
        fs[s] += 1
        ft[t] += 1
    a = sum(i>=1 for i in fs)
    b = sum(i>=1 for i in ft)
    m = min(a,b)
    for s,t in st:
        a_ = a-(fs[s]==1)
        b_ = b-(ft[t]==1)
        m_ = min(a_,b_)
        print(["Yes","No"][m != m_])
    return


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