結果
| 問題 |
No.91 赤、緑、青の石
|
| ユーザー |
holeguma
|
| 提出日時 | 2015-08-17 22:28:36 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 714 bytes |
| コンパイル時間 | 1,739 ms |
| コンパイル使用メモリ | 77,168 KB |
| 実行使用メモリ | 50,592 KB |
| 最終ジャッジ日時 | 2024-07-18 10:04:03 |
| 合計ジャッジ時間 | 4,123 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 WA * 9 |
ソースコード
import java.io.*;
import java.util.Arrays;
class Main{
static final PrintWriter out=new PrintWriter(System.out);
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line=br.readLine();
int[] st=new int[3];
int ans=0;
for(int i=0;i<3;i++) st[i]=Integer.parseInt(line.split(" ")[i]);
Arrays.sort(st);
if(st[0]==st[1]&&st[1]==st[2]) out.println(st[0]);
else if(st[0]==st[1]){
ans+=st[0];
st[2]-=st[0];
ans+=(int)st[2]/5;
out.println(ans);
}
else{
ans+=st[0];
st[1]-=st[0];
st[2]-=st[0];
int cnt=(int)(st[1]+st[2])/4;
if((st[1]+st[2])%4==0&&st[1]==cnt+1||cnt>st[1]) ans+=cnt-1;
else ans+=cnt;
out.println(ans);
}
out.flush();
}
}
holeguma