結果

問題 No.3044 April Sum of Odd
ユーザー 👑 tatt61880tatt61880
提出日時 2020-04-03 02:28:33
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 2,980 ms
コンパイル使用メモリ 157,380 KB
実行使用メモリ 19,272 KB
最終ジャッジ日時 2023-10-14 16:05:07
合計ジャッジ時間 4,027 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 3 ms
4,352 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 71 ms
19,272 KB
testcase_11 AC 46 ms
18,496 KB
testcase_12 AC 2 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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