結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
50,432 KB
testcase_01 AC 44 ms
50,632 KB
testcase_02 AC 43 ms
50,092 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 43 ms
50,500 KB
testcase_08 AC 44 ms
50,204 KB
testcase_09 AC 43 ms
50,108 KB
testcase_10 AC 44 ms
50,736 KB
testcase_11 AC 43 ms
50,280 KB
testcase_12 AC 43 ms
50,484 KB
testcase_13 AC 43 ms
49,976 KB
testcase_14 AC 42 ms
50,052 KB
testcase_15 AC 43 ms
50,016 KB
testcase_16 AC 43 ms
50,264 KB
testcase_17 AC 44 ms
49,924 KB
testcase_18 AC 43 ms
50,368 KB
testcase_19 AC 43 ms
50,220 KB
testcase_20 AC 43 ms
50,208 KB
testcase_21 AC 44 ms
50,032 KB
testcase_22 AC 45 ms
50,224 KB
testcase_23 AC 45 ms
49,920 KB
testcase_24 AC 43 ms
50,224 KB
testcase_25 AC 44 ms
50,048 KB
testcase_26 WA -
testcase_27 AC 44 ms
50,460 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 44 ms
50,532 KB
testcase_31 AC 43 ms
50,408 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) ans+=cnt-1;
else ans+=cnt;
out.println(ans);
}
out.flush();
}
}
0