結果

問題 No.921 ずんだアロー
ユーザー 👑 tatt61880tatt61880
提出日時 2020-03-25 00:49:49
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 2,342 ms
コンパイル使用メモリ 157,196 KB
実行使用メモリ 18,792 KB
最終ジャッジ日時 2023-10-14 16:00:03
合計ジャッジ時間 4,548 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 59 ms
17,388 KB
testcase_11 AC 62 ms
18,436 KB
testcase_12 AC 13 ms
6,572 KB
testcase_13 AC 41 ms
13,988 KB
testcase_14 AC 46 ms
15,368 KB
testcase_15 AC 30 ms
10,704 KB
testcase_16 AC 6 ms
5,040 KB
testcase_17 AC 48 ms
16,140 KB
testcase_18 AC 64 ms
18,756 KB
testcase_19 AC 65 ms
18,748 KB
testcase_20 AC 64 ms
18,756 KB
testcase_21 AC 64 ms
18,584 KB
testcase_22 AC 64 ms
18,596 KB
testcase_23 AC 64 ms
18,508 KB
testcase_24 AC 64 ms
18,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@input().toInt(&)
	var ss: [][]char :: cui@input().split(" ")
	var a: []int :: #[n]int
	for i(0, n - 1)
		do a[i] :: ss[i].toInt(&)
	end for
	
	var ans: int :: 0
	var prev: int :: -1
	var prevId: int :: -2
	for i(0, n - 1)
		if(prevId = i - 2 | a[i] = prev)
			do prevId :: i
			do prev :: a[i]
			do ans :+ 1
		end if
	end for
	do cui@print("\{ans}\n")
end func
0