結果

問題 No.1185 完全な3の倍数
ユーザー 👑 tatt61880tatt61880
提出日時 2021-02-18 00:07:30
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 2,111 ms
コンパイル使用メモリ 147,012 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 17:12:22
合計ジャッジ時間 4,266 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 1 ms
4,352 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,352 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,352 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,352 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 2 ms
4,348 KB
testcase_40 AC 2 ms
4,352 KB
testcase_41 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var s: []char :: cui@input()
	var ans: int :: 0
	if(^s > 2)
		var f: int :: 1
		for i(0, ^s - 1)
			var d: int :: s[i] $ int - '0' $ int
			if(d % 3 = 0)
				do ans :+ (d / 3) * 4 ^ (^s - 1 - i)
				if(i = ^s - 1)
					do ans :+ f
				end if
			else
				do ans :+ (d / 3 + 1) * 4 ^ (^s - 1 - i)
				do f :: 0
			end if
		end for
		do ans :+ 14
	else
		var n: int :: s.toInt(&)
		for i(10, n)
			var a: int :: i % 10
			var b: int :: i / 10
			if((a + b) % 3 = 0)
				do ans :+ 1
			end if
		end for
	end if
	do cui@print("\{ans}\n")
end func
0