結果

問題 No.647 明太子
ユーザー 👑 tatt61880tatt61880
提出日時 2020-04-28 23:57:36
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 55 ms / 4,500 ms
コード長 631 bytes
コンパイル時間 2,017 ms
コンパイル使用メモリ 149,204 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 16:43:50
合計ジャッジ時間 4,293 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 4 ms
4,348 KB
testcase_11 AC 3 ms
4,352 KB
testcase_12 AC 4 ms
4,352 KB
testcase_13 AC 6 ms
4,352 KB
testcase_14 AC 44 ms
4,348 KB
testcase_15 AC 8 ms
4,352 KB
testcase_16 AC 3 ms
4,348 KB
testcase_17 AC 51 ms
4,348 KB
testcase_18 AC 55 ms
4,352 KB
testcase_19 AC 11 ms
4,348 KB
testcase_20 AC 10 ms
4,348 KB
testcase_21 AC 5 ms
4,352 KB
testcase_22 AC 40 ms
4,352 KB
testcase_23 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var a: []int :: #[n]int
	var b: []int :: #[n]int
	for i(0, n - 1)
		do a[i] :: cui@inputInt()
		do b[i] :: cui@inputInt()
	end for
	
	var m: int :: cui@inputInt()
	var cnt: []int :: #[m]int
	for i(0, m - 1)
		var x: int :: cui@inputInt()
		var y: int :: cui@inputInt()
		for j(0, n - 1)
			if(x <= a[j] & y >= b[j])
				do cnt[i] :+ 1
			end if
		end for
	end for
	var max: int :: 0
	for i(0, m - 1)
		do max :: [max, cnt[i]].max()
	end for
	if(max = 0)
		do cui@print("0\n")
	else
		for i(0, m - 1)
			if(cnt[i] = max)
				do cui@print("\{i + 1}\n")
			end if
		end for
	end if
end func
0