結果

問題 No.1679 マスゲーム
ユーザー 👑 tatt61880tatt61880
提出日時 2023-03-14 20:08:32
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 502 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 2,738 ms
コンパイル使用メモリ 146,520 KB
実行使用メモリ 12,116 KB
最終ジャッジ日時 2023-10-18 12:00:11
合計ジャッジ時間 9,600 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 502 ms
12,112 KB
testcase_04 AC 489 ms
12,108 KB
testcase_05 AC 477 ms
12,100 KB
testcase_06 AC 485 ms
12,112 KB
testcase_07 AC 488 ms
12,116 KB
testcase_08 AC 486 ms
12,108 KB
testcase_09 AC 486 ms
12,116 KB
testcase_10 AC 491 ms
12,112 KB
testcase_11 AC 494 ms
12,116 KB
testcase_12 AC 31 ms
4,944 KB
testcase_13 AC 165 ms
7,692 KB
testcase_14 AC 500 ms
12,096 KB
testcase_15 AC 410 ms
11,104 KB
testcase_16 AC 340 ms
10,248 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 229 ms
4,348 KB
testcase_19 AC 3 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 3 ms
4,348 KB
testcase_22 AC 3 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 3 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var red: dict<int, int> :: #dict<int, int>
	var blue: dict<int, int> :: #dict<int, int>
	
	var ans: int :: 0
	
	for(1, n)
		var a: int :: cui@inputInt()
		var b: int :: cui@inputInt()
		var t: int :: cui@inputInt()
		var pos: int :: b - t
		if(a = 0)
			do red.add(pos, red.get(pos, &) + 1)
			do ans :+ blue.get(pos, &)
		else
			do blue.add(pos, blue.get(pos, &) + 1)
			do ans :+ red.get(pos, &)
		end if
	end for
	
	do cui@print("\{ans}\n")
end func
0