結果
| 問題 |
No.110 しましまピラミッド
|
| コンテスト | |
| ユーザー |
kohaku_kohaku
|
| 提出日時 | 2016-12-03 06:24:15 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 938 bytes |
| コンパイル時間 | 2,890 ms |
| コンパイル使用メモリ | 80,096 KB |
| 実行使用メモリ | 58,896 KB |
| 最終ジャッジ日時 | 2024-11-27 17:52:18 |
| 合計ジャッジ時間 | 8,523 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 26 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int Nw = sc.nextInt();
int [] W = new int [Nw];
for(int i=0; i<Nw; i++){
W[i] = sc.nextInt();
}
int Nb = sc.nextInt();
int [] B = new int [Nb];
for(int i=0; i<Nb; i++){
B[i] = sc.nextInt();
}
Arrays.sort(B);
int rw=arrange(W,B,W[0]);
int rb=arrange(B,W,B[0]);
int ans=Math.max(rw,rb);
System.out.println(rw+" "+rb+" "+ans);
}
static int arrange(int []a, int []b, int c){
if(c>=b[b.length-1]){
return 1;
}else{
for(int i=0; i<b.length; i++){
if(c<b[i]){
c=b[i];
break;
}
}
int x=1+arrange(b,a,c);
return x;
}
}
}
kohaku_kohaku