結果

問題 No.3044 April Sum of Odd
ユーザー 👑 tatt61880tatt61880
提出日時 2019-04-01 21:46:50
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 2,339 ms
コンパイル使用メモリ 155,756 KB
実行使用メモリ 19,412 KB
最終ジャッジ日時 2023-10-14 15:37:14
合計ジャッジ時間 3,304 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,356 KB
testcase_03 AC 6 ms
4,824 KB
testcase_04 AC 7 ms
4,768 KB
testcase_05 AC 7 ms
4,924 KB
testcase_06 AC 9 ms
5,080 KB
testcase_07 AC 4 ms
4,524 KB
testcase_08 AC 6 ms
4,740 KB
testcase_09 AC 8 ms
4,784 KB
testcase_10 AC 71 ms
19,412 KB
testcase_11 AC 45 ms
17,988 KB
testcase_12 AC 2 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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