結果
問題 | No.88 次はどっちだ |
ユーザー | rf141 |
提出日時 | 2015-08-09 20:08:44 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 122 ms / 5,000 ms |
コード長 | 678 bytes |
コンパイル時間 | 5,173 ms |
コンパイル使用メモリ | 73,344 KB |
実行使用メモリ | 57,836 KB |
最終ジャッジ日時 | 2023-09-25 07:35:30 |
合計ジャッジ時間 | 5,899 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 118 ms
55,784 KB |
testcase_01 | AC | 120 ms
55,652 KB |
testcase_02 | AC | 121 ms
56,000 KB |
testcase_03 | AC | 117 ms
55,488 KB |
testcase_04 | AC | 117 ms
56,108 KB |
testcase_05 | AC | 117 ms
55,744 KB |
testcase_06 | AC | 119 ms
55,712 KB |
testcase_07 | AC | 119 ms
56,052 KB |
testcase_08 | AC | 119 ms
55,720 KB |
testcase_09 | AC | 122 ms
55,732 KB |
testcase_10 | AC | 119 ms
57,836 KB |
ソースコード
import java.util.*; public class WhoIsNext{ public static void main(String... args){ Scanner scan = new Scanner(System.in); String f = scan.next(); StringBuilder sb = new StringBuilder(); for(int i = 0; i < 8; i++){ sb.append(scan.next()); } String base = sb.toString(); System.out.println(checkWhoIsNext(f,base)); } public static String checkWhoIsNext(String f,String base){ int count = 0; String next=""; if(f.equals("oda")){ next="yukiko"; }else{ next="oda"; } for(int i = 0; i < base.length(); i++){ if(base.substring(i,i+1).equals("w") || base.substring(i,i+1).equals("b")){ count++; } } return (count%2==0)? f:next; } }