結果

問題 No.3137 Non-Intersect Chord Triangle Game
ユーザー titia
提出日時 2025-05-04 01:48:52
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 833 ms / 2,000 ms
コード長 599 bytes
コンパイル時間 636 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 37,736 KB
最終ジャッジ日時 2025-05-04 01:49:28
合計ジャッジ時間 34,790 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 65
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from operator import itemgetter

N,M=map(int,input().split())

LIST=[0]*N

for i in range(M):
    p,q=map(int,input().split())
    p-=1
    q-=1
    if p>q:
        p,q=q,p
    LIST[p]=1
    LIST[q]=2

ANS=[0]*N
Q=[]
now=0
for i in range(N):
    if LIST[i]==1:
        Q.append([i,1])
    elif LIST[i]==2:
        x,c=Q.pop()
        ANS[x]=c+1
    else:
        if Q:
            Q[-1][1]+=1

    #print(Q)

S=[N-sum(ANS)]

for ans in ANS:
    if ans>=2:
        S.append(ans-2)

for s in S:
    if s%4==2:
        print("Akane")
        exit()

print("Aoi")
0