結果
問題 | No.647 明太子 |
ユーザー |
|
提出日時 | 2018-04-02 10:35:06 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 878 bytes |
コンパイル時間 | 2,367 ms |
コンパイル使用メモリ | 78,420 KB |
実行使用メモリ | 63,444 KB |
最終ジャッジ日時 | 2024-06-26 06:31:49 |
合計ジャッジ時間 | 9,409 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 4 |
other | WA * 1 RE * 19 |
ソースコード
import java.util.ArrayList; import java.util.Scanner; public class Main { static ArrayList<P>list = new ArrayList<>(); static public class P{ int yen,karasa; P(int a,int b){ this.yen = a; this.karasa = b; }public boolean buy(int a,int b){ if(a<=yen&&karasa<=b){ return true; }return false; } } static public void Make_P(){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0;i<n;i++){ list.add(new P(sc.nextInt(),sc.nextInt())); } } static public void hantei_mentai(){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 1;i<=n;i++){ int a = sc.nextInt(); int b = sc.nextInt(); boolean c = true; for(P p:list){ if(p.buy(a,b)==false){c = false;break;} }if(c){System.out.println(i);} } } public static void main(String[] args) { Make_P(); hantei_mentai(); } }