結果
問題 | No.647 明太子 |
ユーザー | shinwisteria |
提出日時 | 2018-03-04 18:33:11 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 829 bytes |
コンパイル時間 | 3,594 ms |
コンパイル使用メモリ | 75,844 KB |
実行使用メモリ | 64,472 KB |
最終ジャッジ日時 | 2023-08-27 02:28:47 |
合計ジャッジ時間 | 9,116 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 116 ms
55,352 KB |
testcase_01 | AC | 115 ms
55,748 KB |
testcase_02 | AC | 111 ms
55,432 KB |
testcase_03 | AC | 112 ms
55,520 KB |
testcase_04 | AC | 115 ms
55,900 KB |
testcase_05 | AC | 113 ms
55,508 KB |
testcase_06 | AC | 112 ms
55,832 KB |
testcase_07 | AC | 124 ms
56,016 KB |
testcase_08 | AC | 126 ms
55,860 KB |
testcase_09 | AC | 177 ms
58,616 KB |
testcase_10 | AC | 184 ms
58,668 KB |
testcase_11 | AC | 168 ms
55,952 KB |
testcase_12 | AC | 187 ms
58,456 KB |
testcase_13 | AC | 194 ms
58,664 KB |
testcase_14 | AC | 399 ms
61,732 KB |
testcase_15 | AC | 219 ms
59,104 KB |
testcase_16 | AC | 192 ms
58,996 KB |
testcase_17 | AC | 417 ms
63,100 KB |
testcase_18 | AC | 420 ms
62,844 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 493 ms
64,472 KB |
testcase_23 | AC | 153 ms
56,504 KB |
ソースコード
package m.shin; import java.util.Scanner; public class Con647 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt(); int[][] ab = new int[N][2]; for(int i = 0;i < N;i++){ ab[i][0] = s.nextInt(); ab[i][1] = s.nextInt(); } int M = s.nextInt(); int[] count = new int[M]; for(int i = 0;i < M;i++){ int x = s.nextInt() , y = s.nextInt(); for(int j = 0;j < N;j++){ if(ab[j][0] >= x && ab[j][1] <= y){ count[i]++; } } } s.close(); N = 0; for(int i = 0;i < 2;i++){ for(int j = 0;j < M;j++){ if(i == 0){ if(count[j] >= count[N]){ N = j; } }else{ if(count[j] ==count[N] && count[N] != 0){ System.out.println(j+1); }else if(count[N] == 0){ System.out.println(N); } } } } } }