結果

問題 No.91 赤、緑、青の石
ユーザー holegumaholeguma
提出日時 2015-08-17 22:28:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 2,186 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 52,112 KB
最終ジャッジ日時 2023-09-25 12:39:26
合計ジャッジ時間 4,592 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
50,316 KB
testcase_01 AC 43 ms
50,148 KB
testcase_02 AC 43 ms
50,228 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 44 ms
49,900 KB
testcase_08 AC 44 ms
50,000 KB
testcase_09 AC 43 ms
50,268 KB
testcase_10 AC 44 ms
50,096 KB
testcase_11 AC 43 ms
50,132 KB
testcase_12 AC 44 ms
50,216 KB
testcase_13 AC 44 ms
50,336 KB
testcase_14 AC 43 ms
50,512 KB
testcase_15 AC 43 ms
49,960 KB
testcase_16 AC 43 ms
50,172 KB
testcase_17 AC 44 ms
49,992 KB
testcase_18 AC 44 ms
50,484 KB
testcase_19 AC 43 ms
50,184 KB
testcase_20 AC 44 ms
50,224 KB
testcase_21 WA -
testcase_22 AC 44 ms
49,924 KB
testcase_23 AC 43 ms
49,888 KB
testcase_24 AC 43 ms
50,004 KB
testcase_25 AC 44 ms
50,108 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 44 ms
48,400 KB
testcase_31 AC 44 ms
50,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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();
}
}
0