結果

問題 No.2460 #強調#
ユーザー kusagame12kusagame12
提出日時 2023-11-09 20:44:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 668 bytes
コンパイル時間 2,149 ms
コンパイル使用メモリ 73,920 KB
実行使用メモリ 54,000 KB
最終ジャッジ日時 2023-11-09 20:44:15
合計ジャッジ時間 4,282 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
53,988 KB
testcase_01 AC 52 ms
53,980 KB
testcase_02 AC 53 ms
53,980 KB
testcase_03 AC 53 ms
53,996 KB
testcase_04 AC 52 ms
53,988 KB
testcase_05 AC 53 ms
53,992 KB
testcase_06 AC 52 ms
54,000 KB
testcase_07 AC 52 ms
53,996 KB
testcase_08 AC 53 ms
53,976 KB
testcase_09 AC 56 ms
53,980 KB
testcase_10 AC 52 ms
53,984 KB
testcase_11 AC 53 ms
53,992 KB
testcase_12 AC 55 ms
53,976 KB
testcase_13 AC 53 ms
53,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] str = br.readLine().toCharArray();
        
        StringBuilder sb = new StringBuilder(str.length);
        boolean flag = false;
        for (int i = 0 , len = str.length ; i < len ; i++){
            
            char c = str[i];
            
            if(c == '#'){
                flag = !flag;
            }else if(flag){
                sb.append(c);
            }
            
        } 
        
        System.out.println(sb);

    }

}
0