結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
37zigen
|
| 提出日時 | 2016-05-01 23:02:26 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 240 ms / 5,000 ms |
| コード長 | 654 bytes |
| 記録 | |
| コンパイル時間 | 2,372 ms |
| コンパイル使用メモリ | 85,832 KB |
| 実行使用メモリ | 47,132 KB |
| 最終ジャッジ日時 | 2025-12-07 12:25:54 |
| 合計ジャッジ時間 | 8,068 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
package yukicoder;
import java.util.Arrays;
import java.util.Scanner;
public class Main{
public static void main(String[] args)throws Exception{
new Main().solve();
}
void solve(){
Scanner sc=new Scanner(System.in);
int[] d=new int[3];
d[0]=sc.nextInt();
d[1]=sc.nextInt();
d[2]=sc.nextInt();
Arrays.sort(d);
int ans=0;
ans+=d[0];
d[1]-=d[0];d[2]-=d[0];d[0]-=d[0];
while(d[2]>=2){
Arrays.sort(d);
d[2]-=2;
d[0]+=1;
if(d[1]==0||d[2]==0)continue;
ans+=d[0];
d[1]-=d[0];d[2]-=d[0];d[0]-=d[0];
Arrays.sort(d);
}
System.out.println(ans);
}
void tr(Object...o){System.out.println(Arrays.deepToString(o));}
}
37zigen