結果

問題 No.647 明太子
ユーザー sudo_yum
提出日時 2018-05-24 19:24:57
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 780 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 77,192 KB
実行使用メモリ 59,400 KB
最終ジャッジ日時 2024-06-28 17:30:52
合計ジャッジ時間 7,770 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 3 WA * 17
権限があれば一括ダウンロードができます

ソースコード

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