結果

問題 No.91 赤、緑、青の石
ユーザー holegumaholeguma
提出日時 2015-08-17 22:48:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 785 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 74,388 KB
実行使用メモリ 52,700 KB
最終ジャッジ日時 2023-09-06 12:13:53
合計ジャッジ時間 5,585 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
52,700 KB
testcase_01 AC 108 ms
52,176 KB
testcase_02 AC 93 ms
52,696 KB
testcase_03 AC 109 ms
52,616 KB
testcase_04 AC 97 ms
52,608 KB
testcase_05 AC 111 ms
52,688 KB
testcase_06 AC 46 ms
50,016 KB
testcase_07 AC 46 ms
50,144 KB
testcase_08 AC 46 ms
50,152 KB
testcase_09 AC 45 ms
50,056 KB
testcase_10 AC 45 ms
50,176 KB
testcase_11 AC 98 ms
52,444 KB
testcase_12 AC 107 ms
52,396 KB
testcase_13 AC 125 ms
51,892 KB
testcase_14 AC 100 ms
52,500 KB
testcase_15 AC 122 ms
52,460 KB
testcase_16 AC 45 ms
50,060 KB
testcase_17 AC 44 ms
50,144 KB
testcase_18 AC 44 ms
50,500 KB
testcase_19 AC 43 ms
50,064 KB
testcase_20 AC 43 ms
50,144 KB
testcase_21 AC 41 ms
50,156 KB
testcase_22 AC 41 ms
50,264 KB
testcase_23 AC 43 ms
50,144 KB
testcase_24 AC 40 ms
50,144 KB
testcase_25 AC 129 ms
51,888 KB
testcase_26 AC 127 ms
52,460 KB
testcase_27 AC 40 ms
50,524 KB
testcase_28 AC 41 ms
50,152 KB
testcase_29 AC 40 ms
50,340 KB
testcase_30 AC 39 ms
50,300 KB
testcase_31 AC 120 ms
52,392 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];
st[0]=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();
}
}
0