結果

問題 No.436 ccw
ユーザー NaruYNaruY
提出日時 2016-12-09 17:00:50
言語 Java19
(openjdk 21)
結果
AC  
実行時間 200 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 1,887 ms
コンパイル使用メモリ 72,648 KB
実行使用メモリ 59,996 KB
最終ジャッジ日時 2023-08-19 03:15:24
合計ジャッジ時間 6,931 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
55,928 KB
testcase_01 AC 101 ms
56,060 KB
testcase_02 AC 105 ms
55,780 KB
testcase_03 AC 102 ms
53,848 KB
testcase_04 AC 100 ms
55,688 KB
testcase_05 AC 102 ms
55,932 KB
testcase_06 AC 107 ms
55,484 KB
testcase_07 AC 107 ms
56,132 KB
testcase_08 AC 109 ms
55,752 KB
testcase_09 AC 108 ms
55,524 KB
testcase_10 AC 103 ms
55,812 KB
testcase_11 AC 103 ms
55,796 KB
testcase_12 AC 102 ms
55,732 KB
testcase_13 AC 98 ms
55,720 KB
testcase_14 AC 107 ms
55,888 KB
testcase_15 AC 110 ms
55,484 KB
testcase_16 AC 138 ms
55,952 KB
testcase_17 AC 113 ms
56,080 KB
testcase_18 AC 124 ms
55,824 KB
testcase_19 AC 141 ms
55,704 KB
testcase_20 AC 138 ms
55,712 KB
testcase_21 AC 200 ms
59,996 KB
testcase_22 AC 195 ms
59,608 KB
testcase_23 AC 185 ms
59,188 KB
testcase_24 AC 179 ms
59,240 KB
testcase_25 AC 187 ms
59,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
 
public class Main {
    public static void main (String[] args) throws IOException
    {
    	Scanner sc = new Scanner(System.in);
    	String s = sc.nextLine();
    	int cs = 0 ;
    	
    	
    	for (int i = 2 ; (s.substring(i-1,i)).equals("c"); i++){
    		cs = i;
    	}
    	
    	int n = s.length();
    	
    	int ans = Math.min(cs-1,n-cs);
    	System.out.println(ans);
    	
    	
    }    	
}
    
0