結果

問題 No.3137 Non-Intersect Chord Triangle Game
ユーザー 👑 loop0919
提出日時 2025-05-01 20:34:53
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 442 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 82,116 KB
実行使用メモリ 162,740 KB
最終ジャッジ日時 2025-05-01 20:35:09
合計ジャッジ時間 14,148 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other AC * 16 RE * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N, M = map(int, input().split())
P = set()
Q = set()

for _ in range(M):
    p, q = sorted(map(int, input().split()))
    P.add(p)
    Q.add(q)

stack = []
dic = defaultdict(int)

for i in range(1, N + 1):
    if i in P:
        stack.append(i)
    elif i in Q:
        stack.pop()
    else:
        dic[stack[-1]] += 1

if any(a % 4 == 2 for a in dic.values()):
    print("Akane")
else:
    print("Aoi")
0