結果
| 問題 |
No.91 赤、緑、青の石
|
| ユーザー |
holeguma
|
| 提出日時 | 2015-08-17 22:48:06 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 785 bytes |
| コンパイル時間 | 1,870 ms |
| コンパイル使用メモリ | 77,976 KB |
| 実行使用メモリ | 54,132 KB |
| 最終ジャッジ日時 | 2024-07-18 10:04:29 |
| 合計ジャッジ時間 | 5,881 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 9 WA * 19 |
ソースコード
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[0]=0;
st[1]-=st[0];
st[2]-=st[0];
if(3*st[1]<=st[2]){
ans+=st[1];
st[2]-=3*st[1];
ans+=(int)st[2]/5;
}
else{
while(st[2]>=3&&st[1]>0){
ans++;
st[1]--;
st[2]-=3;
Arrays.sort(st);
}
ans+=(int)st[2]/5;
}
out.println(ans);
}
out.flush();
}
}
holeguma