結果

問題 No.3845 eval("G4M3")
コンテスト
ユーザー lif4635
提出日時 2026-12-03 20:55:07
結果
AC  
実行時間 440 ms / 2,000 ms
+ 293µs
コード長 345 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 82 ms
コンパイル使用メモリ 63,972 KB
実行使用メモリ 70,020 KB
最終ジャッジ日時 2026-12-03 20:55:16
合計ジャッジ時間 8,711 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 49
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

odd = "13579"
t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	oo = 0
	for i in range(n - 1):
		if s[i] in odd and s[i+1] in odd:
			oo = 1
	f = 0
	if n & 1 == 0:
		if (s[0] in odd) or (s[-1] in odd):
			f = 1
		if oo:
			f = 1
	else:
		if ((s[0] in odd) ^ (s[-1] in odd)) and oo == 0:
			f = 1
	print("Alice" if f else "Bob")
0