結果
問題 |
No.647 明太子
|
ユーザー |
|
提出日時 | 2018-06-21 23:07:49 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 544 ms / 4,500 ms |
コード長 | 623 bytes |
コンパイル時間 | 1,964 ms |
コンパイル使用メモリ | 76,984 KB |
実行使用メモリ | 63,904 KB |
最終ジャッジ日時 | 2024-06-30 17:45:23 |
合計ジャッジ時間 | 8,461 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
import java.util.Scanner; class no647{ public static void main(String[] args) { Scanner stdIn=new Scanner(System.in); int n,m,a[]=new int[10000],b[]=new int[10000],c[]=new int[1000],x,y,i,j,max=1; n=stdIn.nextInt(); for(i=0;i<n;i++) { a[i]=stdIn.nextInt(); b[i]=stdIn.nextInt(); } m=stdIn.nextInt(); for(i=0;i<m;i++) { x=stdIn.nextInt(); y=stdIn.nextInt(); for(j=0;j<n;j++) if(a[j]>=x&&b[j]<=y) c[i]++; if(max<c[i]) max=c[i]; } j=0; for(i=0;i<m;i++) { if(c[i]==max) { System.out.println(i+1); j++; } } if(j==0) System.out.print("0"); } }