結果

問題 No.3137 Non-Intersect Chord Triangle Game
ユーザー 👑 loop0919
提出日時 2025-05-01 20:03:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 163,052 KB
最終ジャッジ日時 2025-05-01 20:28:52
合計ジャッジ時間 18,860 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 65
権限があれば一括ダウンロードができます

ソースコード

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 = [0]
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