結果

問題 No.3137 Non-Intersect Chord Triangle Game
ユーザー umezo
提出日時 2025-05-02 23:37:04
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,083 bytes
コンパイル時間 3,246 ms
コンパイル使用メモリ 284,440 KB
実行使用メモリ 43,392 KB
最終ジャッジ日時 2025-05-02 23:37:18
合計ジャッジ時間 11,252 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
template <class T> using V=vector<T>;
template <class T> using VV=V<V<T>>;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n,m;
  cin>>n>>m;
  V<int> P(m),Q(m),A(2*n,-1),L(2*n,-1),R(2*n,-1);
  rep(i,m){
    cin>>P[i]>>Q[i];
    P[i]--,Q[i]--;
    A[P[i]]=i,A[P[i]+n]=i;
    A[Q[i]]=i,A[Q[i]+n]=i;
  }
  if(m==0){
    if(n%4==2) cout<<"Akane"<<endl;
    else cout<<"Aoi"<<endl;
    return 0;
  }
  int now=-1;
  rep(i,2*n){
    if(A[i]!=-1) now=A[i];
    else L[i]=now; 
  }
  now=-1;
  for(int i=2*n-1;i>=0;i--){
    if(A[i]!=-1) now=A[i];
    else R[i]=now;
  }
  map<pair<int,int>,int> mp;
  rep(i,n){
    if(A[i]!=-1) continue;
    int l,r;
    if(L[i]!=-1) l=L[i];
    else l=L[i+n];
    if(R[i]!=-1) r=R[i];
    else r=R[i+n];
    if(l>r) swap(l,r);
    mp[{l,r}]++;
  }
  for(auto [a,b]:mp){
    if(b%4==2){
      cout<<"Akane"<<endl;
      return 0;
    }
  }
  cout<<"Aoi"<<endl;
    
  return 0;
}
0