結果
| 問題 | No.3137 Non-Intersect Chord Triangle Game |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2025-05-02 23:09:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 315 ms / 2,000 ms |
| コード長 | 563 bytes |
| 記録 | |
| コンパイル時間 | 230 ms |
| コンパイル使用メモリ | 96,232 KB |
| 実行使用メモリ | 115,912 KB |
| 最終ジャッジ日時 | 2026-07-10 11:23:39 |
| 合計ジャッジ時間 | 12,180 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 65 |
ソースコード
from collections import deque
N,M=map(int,input().split())
In=[0]*(N+1)
OUT=[0]*(N+1)
for _ in range(M):
P,Q=map(int,input().split())
P,Q=min(P,Q),max(P,Q)
In[P]=1
OUT[Q]=1
def ok(n):
return n%4==2
if M==0:
if ok(N):
print('Akane')
else:
print('Aoi')
exit()
dq = []
dq.append(N+1)
ans = [0]*(N+2)
for i in range(1,N+1):
if In[i] == 1:
dq.append(i)
elif OUT[i] == 1:
dq.pop()
else:
ans[dq[-1]] += 1
for a in ans:
if ok(a):
print('Akane')
exit()
print('Aoi')
nikoro256