結果

問題 No.647 明太子
ユーザー sudo_yumsudo_yum
提出日時 2018-05-24 19:24:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 780 bytes
コンパイル時間 2,107 ms
コンパイル使用メモリ 74,072 KB
実行使用メモリ 62,724 KB
最終ジャッジ日時 2023-09-11 02:59:05
合計ジャッジ時間 8,977 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 127 ms
56,000 KB
testcase_02 AC 128 ms
55,720 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 334 ms
60,524 KB
testcase_20 AC 332 ms
60,688 KB
testcase_21 AC 261 ms
60,204 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] membA = new int[n];
    int[] membB = new int[n];
    for (int i=0;i<n ;i++ ) {
      membA[i] = sc.nextInt();
      membB[i] = sc.nextInt();
    }
    int m = sc.nextInt();
    int[] result = new int[m];
    Arrays.fill(result,0);
    int[] kin = new int[m];
    int[] kara = new int[m];
    for (int j=0;j<m ;j++ ) {
      kin[j] = sc.nextInt();
      kara[j] = sc.nextInt();
    }
    for (int i=0;i<n ;i++ ) {
      for (int j=0;j<m ;j++ ) {
        if (kin[j]<=membA[i]&&membB[i]<=kara[j]) {
          result[j] +=1;
        }else{};
      }
    }
    Arrays.sort(result);
    System.out.println(result[0]);
  }
}
0