結果

問題 No.1623 三角形の制作
ユーザー 👑 tatt61880tatt61880
提出日時 2021-07-28 00:06:27
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 236 ms / 2,000 ms
コード長 626 bytes
コンパイル時間 2,153 ms
コンパイル使用メモリ 149,172 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 18:38:24
合計ジャッジ時間 7,955 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 151 ms
4,352 KB
testcase_03 AC 144 ms
4,352 KB
testcase_04 AC 143 ms
4,348 KB
testcase_05 AC 236 ms
4,348 KB
testcase_06 AC 60 ms
4,356 KB
testcase_07 AC 145 ms
4,348 KB
testcase_08 AC 63 ms
4,348 KB
testcase_09 AC 136 ms
4,352 KB
testcase_10 AC 203 ms
4,352 KB
testcase_11 AC 163 ms
4,348 KB
testcase_12 AC 65 ms
4,348 KB
testcase_13 AC 80 ms
4,352 KB
testcase_14 AC 77 ms
4,348 KB
testcase_15 AC 191 ms
4,348 KB
testcase_16 AC 190 ms
4,348 KB
testcase_17 AC 191 ms
4,352 KB
testcase_18 AC 221 ms
4,352 KB
testcase_19 AC 100 ms
4,348 KB
testcase_20 AC 2 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var rn: []int :: #[3001]int
	var gn: []int :: #[3001]int
	var bn: []int :: #[3001]int
	for(1, n)
		do rn[cui@inputInt()] :+ 1
	end for
	for(1, n)
		do gn[cui@inputInt()] :+ 1
	end for
	for(1, n)
		do bn[cui@inputInt()] :+ 1
	end for
	
	var cumR: []int :: #[3001]int
	for r(1, 3000)
		do cumR[r] :: cumR[r - 1] + rn[r]
	end for
	
	var ans: int :: 0
	for g(1, 3000)
		if(gn[g] <> 0)
			for b(1, 3000)
				if(bn[b] <> 0)
					do ans :+ gn[g] * bn[b] * (cumR[lib@min(g + b - 1, 3000)] - cumR[lib@max(g, b) - 1])
				end if
			end for
		end if
	end for
	do cui@print("\{ans}\n")
end func
0