結果
問題 | No.161 制限ジャンケン |
ユーザー | chiho_miyako |
提出日時 | 2015-04-13 13:11:12 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,659 bytes |
コンパイル時間 | 3,536 ms |
コンパイル使用メモリ | 73,292 KB |
実行使用メモリ | 57,888 KB |
最終ジャッジ日時 | 2023-09-17 19:58:24 |
合計ジャッジ時間 | 6,435 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 122 ms
55,484 KB |
testcase_02 | AC | 122 ms
56,044 KB |
testcase_03 | AC | 122 ms
55,672 KB |
testcase_04 | AC | 123 ms
55,232 KB |
testcase_05 | AC | 124 ms
55,576 KB |
testcase_06 | AC | 127 ms
56,084 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 125 ms
55,964 KB |
testcase_11 | AC | 125 ms
55,704 KB |
testcase_12 | AC | 128 ms
56,024 KB |
testcase_13 | WA | - |
testcase_14 | AC | 124 ms
56,000 KB |
testcase_15 | AC | 123 ms
55,476 KB |
testcase_16 | AC | 125 ms
55,636 KB |
testcase_17 | AC | 124 ms
56,160 KB |
testcase_18 | WA | - |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); int gi = koko.nextInt(); int ci = koko.nextInt(); int pi = koko.nextInt(); int gy = 0; int cy = 0; int py = 0; String s = koko.next(); for(int i=0; i<s.length(); i++){ if(s.charAt(i)=='G'){ gy++; }else if(s.charAt(i)=='C'){ cy++; }else{ py++; } } int gp=0; int cp=0; int pp=0; int gr=0; int cr=0; int pr=0; int rp=0; if(pi>=gy){ pp=3*gy; pr=pi-gy; if(ci>=py){ cp=3*py; cr=ci-py; gp=3*gi; rp=cr; }else if(ci<py){ cp=3*ci; if(pr>=(py-ci)){ rp=(py-ci); gp=3*gi; }else if(pr<(py-ci)){ rp=pr; gp=3*gy; } } }else if(pi<gy){ pp=3*pi; if(gi>=cy){ gp=3*cy; gr=gi-cy; if(gr>=(gy-pi)){ rp=gy-pi; cp=3*py; }else if(gr<(gy-pi)){ rp=gr; cp=3*py; } }else if(gi<cy){ gp=3*gi; cp=3*py; rp=cy-gi; } } System.out.println(gp+cp+pp+rp); } }