Submission #35727949
Source Code Expand
#include <bits/stdc++.h>
const int MAXN = 3e5 + 10;
namespace trash_with_mode{
#define foe(i, now) for (int i = head[now]; ~i; i = edg[i].edg)
#define fo(i, g1, g2) for (int i = (g1), __Endi__ = (g2); i <= __Endi__; ++i)
#define fd(i, g1, g2) for (int i = (g1), __Endi__ = (g2); i >= __Endi__; --i)
#define go(v,now) for (auto &v:edg[now])
#define mem(g1, g2) memset((g1), g2, sizeof((g1)))
#define lowbit(now) ((now) & (-now))
#define lson ((now) << 1)
#define mid ((l + r) / 2)
#define rson (lson | 1)
#define ll long long
#define pb push_back
#define mp(g1, g2) make_pair((g1), (g2))
#define PII pair<int, int>
#define pow2(g2) (1ll << (g2))
#define II inline void
#define INF (0x3f3f3f3f)
#define ps push
#define lsond lson, l, mid
#define rsond rson, mid + 1, r
namespace Fread
{
const int SIZE = (1 << 26) + 1; // namespace Fread
char buf[SIZE], *S, *T;
}
namespace Fwrite
{
const int SIZE = (1 << 26) + 1; // namespace Fwrite
char buf[SIZE], *S = buf, *T = buf + SIZE;
inline void flush()
{
fwrite(buf, 1, S - buf, stdout), S = buf;
}
struct NTR
{
~NTR()
{
flush();
}
} ztr;
}
#ifdef ONLINE_JUDGE
#define getchar() (Fread::S == Fread::T && (Fread::T = (Fread::S = Fread::buf) + fread(Fread::buf, 1, 1 << 23, stdin), Fread::S == Fread::T) ? '\n' : *Fread::S++)
#define putchar(c) (*Fwrite::S++ = c, (Fwrite::S != Fwrite::T) ? 0 : (Fwrite::flush(), 0))
#endif
namespace Fastio
{
struct Reader
{
template <typename T>
inline Reader &operator>>(T &now)
{
static char c;
static short f;
c = getchar(), f = 1;
while (!isdigit(c))
{
c ^ '-' ? c = getchar() : (f = -1, c = getchar());
}
now = 0;
while (isdigit(c))
{
now = now * 10 + (c ^ '0'), c = getchar();
}
return now *= f, *this;
}
inline Reader &operator>>(char &c)
{
c = getchar();
while (c == '\n' || c == ' ')
c = getchar();
return *this;
}
inline Reader &operator>>(char *str)
{
static int len = 0;
len = 0;
static char c;
c = getchar();
while (c == '\n' || c == ' ')
c = getchar();
while (c ^ '\n' && c ^ ' ')
{
str[len++] = c, c = getchar();
}
return str[len] = '\0', *this;
}
Reader() {}
} cin;
const char endl = '\n';
struct Writer
{
template <typename T>
inline Writer &operator<<(T now)
{
static int cnt = 0;
now ? (now < 0 ? putchar('-'), now = -now, cnt = 0 : cnt = 0) : (putchar('0'), cnt = 0);
static int sta[45];
while (now)
{
sta[++cnt] = now % 10, now /= 10;
}
while (cnt)
{
putchar(sta[cnt] | 48), --cnt;
}
return *this;
}
inline Writer &operator<<(const char c)
{
return putchar(c), *this;
}
inline Writer &operator<<(const char *str)
{
static int cur = 0;
cur = 0;
while (str[cur])
putchar(str[cur++]);
return *this;
}
inline Writer &operator<<(char *str)
{
static int cur = 0;
cur = 0;
while (str[cur])
putchar(str[cur++]);
return *this;
}
Writer() {}
} cout;
}
#define cin Fastio ::cin
#define cout Fastio ::cout
#define endl Fastio ::endl
using namespace std;
namespace Mystd {
const int mode=998244353;
inline unsigned highbit(const unsigned now) {return (1u<<(31-__builtin_clz(now)));}
inline long long qpow(ll a,ll b){ll ans=1;for (;b;b>>=1){ if (b&1) ans=ans*a;a=a*a;}return ans;}
inline long long modqpow(ll a,ll b,const int mode1 = mode){ll ans=1;for (;b;b>>=1){if (b&1) ans=ans*a%mode1;a=a*a%mode1;}return ans;}
template<typename _Tp>inline _Tp Max(const _Tp g1, const _Tp g2) {return g1 < g2 ? g2 : g1;}
template<typename _Tp, typename ...Args>inline _Tp Max(const _Tp g1, const _Tp g2, const Args... others) {return Max(Max(g1, g2), others...);}
template<typename _Tp>inline _Tp Min(const _Tp g1, const _Tp g2) {return g1 < g2 ? g1 : g2;}
template<typename _Tp, typename ...Args>inline _Tp Min(const _Tp g1, const _Tp g2, const Args... others) {return Min(Min(g1, g2), others...);}
inline void add(int &a,const int b) {((a+=b)>=mode) && (a-=mode);}
inline void sub(int &a,const int b) {((a-=b)<0) && (a+=mode);}
inline constexpr int add1(const int a,const int b) {return (a+b>=mode ? a+b-mode : a+b);}
inline constexpr int sub1(const int a,const int b) {return (a-b<0 ? a-b+mode : a-b);}
inline constexpr int mul(int a,int b) {return 1ll*a*b%mode;}
}
using namespace Mystd;
}
using namespace trash_with_mode;
#define int ll
ll n,m;
int yyy=0;
PII a[MAXN];
int noww = 0;
signed main()
{
#ifndef ONLINE_JUDGE
freopen("txt.in", "r", stdin);
freopen("txt.out", "w", stdout);
#endif
cin >> n >> m;
if(!m)
{
if(n&1)
{
cout<<"Takahashi";
return 0;
}
cout<<"Aoki";
return 0;
}
fo (i,1,m)
{
int u,v;
cin >> u >> v;
a[yyy++] = mp(u,v);
}
noww=(a[0].first-1)^(n-a[yyy-1].first);
for(int i=1; i<yyy; i++)
{
if(a[i].second==a[i-1].second && a[i].first>1+a[i-1].first)
noww^=1;
}
if(noww)
{
cout<<"Takahashi";
return 0;
}
cout<<"Aoki";
return 0;
}
Submission Info
| Submission Time |
|
| Task |
C - 01 Game |
| User |
lby_my_superman |
| Language |
C++ (GCC 9.2.1) |
| Score |
600 |
| Code Size |
5205 Byte |
| Status |
AC |
| Exec Time |
22 ms |
| Memory |
10820 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
600 / 600 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
example0.txt, example1.txt, example2.txt |
| All |
000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, example0.txt, example1.txt, example2.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 000.txt |
AC |
8 ms |
3508 KiB |
| 001.txt |
AC |
2 ms |
3528 KiB |
| 002.txt |
AC |
3 ms |
3500 KiB |
| 003.txt |
AC |
1 ms |
3456 KiB |
| 004.txt |
AC |
2 ms |
3500 KiB |
| 005.txt |
AC |
2 ms |
3376 KiB |
| 006.txt |
AC |
2 ms |
3540 KiB |
| 007.txt |
AC |
2 ms |
3436 KiB |
| 008.txt |
AC |
15 ms |
8200 KiB |
| 009.txt |
AC |
12 ms |
8280 KiB |
| 010.txt |
AC |
2 ms |
3504 KiB |
| 011.txt |
AC |
2 ms |
3528 KiB |
| 012.txt |
AC |
2 ms |
3364 KiB |
| 013.txt |
AC |
11 ms |
7444 KiB |
| 014.txt |
AC |
9 ms |
5836 KiB |
| 015.txt |
AC |
12 ms |
7432 KiB |
| 016.txt |
AC |
16 ms |
10636 KiB |
| 017.txt |
AC |
17 ms |
10796 KiB |
| 018.txt |
AC |
17 ms |
10660 KiB |
| 019.txt |
AC |
20 ms |
10644 KiB |
| 020.txt |
AC |
18 ms |
10596 KiB |
| 021.txt |
AC |
17 ms |
10688 KiB |
| 022.txt |
AC |
21 ms |
10652 KiB |
| 023.txt |
AC |
17 ms |
10684 KiB |
| 024.txt |
AC |
17 ms |
10748 KiB |
| 025.txt |
AC |
16 ms |
10588 KiB |
| 026.txt |
AC |
22 ms |
10820 KiB |
| 027.txt |
AC |
16 ms |
10592 KiB |
| 028.txt |
AC |
16 ms |
10776 KiB |
| 029.txt |
AC |
17 ms |
10776 KiB |
| 030.txt |
AC |
17 ms |
10636 KiB |
| 031.txt |
AC |
22 ms |
10772 KiB |
| 032.txt |
AC |
15 ms |
10720 KiB |
| 033.txt |
AC |
16 ms |
10660 KiB |
| 034.txt |
AC |
19 ms |
10688 KiB |
| 035.txt |
AC |
16 ms |
10736 KiB |
| 036.txt |
AC |
18 ms |
10688 KiB |
| example0.txt |
AC |
2 ms |
3404 KiB |
| example1.txt |
AC |
2 ms |
3436 KiB |
| example2.txt |
AC |
2 ms |
3380 KiB |