結果

問題 No.806 木を道に
ユーザー 👑 tatt61880tatt61880
提出日時 2021-02-14 20:51:03
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 1,960 ms
コンパイル使用メモリ 150,444 KB
実行使用メモリ 8,612 KB
最終ジャッジ日時 2023-10-14 17:08:46
合計ジャッジ時間 7,203 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 35 ms
4,964 KB
testcase_11 AC 31 ms
4,784 KB
testcase_12 AC 143 ms
7,932 KB
testcase_13 AC 102 ms
6,732 KB
testcase_14 AC 136 ms
7,560 KB
testcase_15 AC 149 ms
7,992 KB
testcase_16 AC 50 ms
5,212 KB
testcase_17 AC 126 ms
7,196 KB
testcase_18 AC 13 ms
4,352 KB
testcase_19 AC 37 ms
5,044 KB
testcase_20 AC 126 ms
7,488 KB
testcase_21 AC 69 ms
5,952 KB
testcase_22 AC 174 ms
8,612 KB
testcase_23 AC 175 ms
8,444 KB
testcase_24 AC 69 ms
6,512 KB
testcase_25 AC 107 ms
7,504 KB
testcase_26 AC 36 ms
5,304 KB
testcase_27 AC 128 ms
8,540 KB
testcase_28 AC 4 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var dic: dict<int, int> :: #dict<int, int>
	var ans: int :: 0
	for(0, n - 2)
		for i(0, 1)
			var a: int :: cui@inputInt()
			var num: int :: dic.get(a, &)
			if(num > 1)
				do ans :+ 1
			end if
			do dic.add(a, num + 1)
		end for
	end for
	do cui@print("\{ans}\n")
end func
0