結果

問題 No.99 ジャンピング駒
ユーザー 👑 tatt61880tatt61880
提出日時 2019-03-19 19:41:31
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 2,656 ms
コンパイル使用メモリ 162,888 KB
実行使用メモリ 19,652 KB
最終ジャッジ日時 2023-10-14 15:29:49
合計ジャッジ時間 3,810 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
19,632 KB
testcase_01 AC 75 ms
19,652 KB
testcase_02 AC 79 ms
19,592 KB
testcase_03 AC 77 ms
19,488 KB
testcase_04 AC 78 ms
19,420 KB
testcase_05 AC 78 ms
19,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var N: int :: cui@input().toInt(&)
	var _: [][]char :: cui@input().split(" ")
	var st: stack<int> :: #stack<int>
	do st.add(_[0].toInt(&))
	for i(1, N - 1)
		var x: int :: _[i].toInt(&)
		if(^st = 0)
			do st.add(x)
			skip i
		end if
		var xPeek: int :: st.peek()
		if((xPeek - x) % 2 = 0)
			do st.add(x)
		else
			do st.get()
		end if
	end for
	var ans: int :: ^st
	do cui@print("\{ans}\n")
end func
0