結果
| 問題 |
No.91 赤、緑、青の石
|
| ユーザー |
ぴろず
|
| 提出日時 | 2014-12-07 20:18:45 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 742 bytes |
| コンパイル時間 | 1,746 ms |
| コンパイル使用メモリ | 74,408 KB |
| 実行使用メモリ | 56,224 KB |
| 最終ジャッジ日時 | 2024-06-11 16:27:26 |
| 合計ジャッジ時間 | 6,330 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 WA * 19 |
ソースコード
package no091;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static final int MAX = 10000000;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] m = new int[3];
for(int i=0;i<3;i++) {
m[i] = sc.nextInt();
}
for(int i=100;i>=0;i--) {
int[] n = Arrays.copyOf(m, 3);
int need = 0;
for(int j=0;j<3;j++) {
if (n[j] < i) {
need += i - n[j];
n[j] = 0;
}else{
n[j] -= i;
}
}
//System.out.println(i + "," + need + "," + Arrays.toString(n));
int amari = 0;
for(int j=0;j<3;j++) {
amari += n[j] / 2;
}
if (amari >= need) {
System.out.println(i);
break;
}
}
}
}
ぴろず