結果

問題 No.1469 programing
ユーザー game_krbgame_krb
提出日時 2021-05-08 15:39:21
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 613 bytes
コンパイル時間 2,819 ms
コンパイル使用メモリ 71,408 KB
実行使用メモリ 102,508 KB
最終ジャッジ日時 2023-10-15 03:03:41
合計ジャッジ時間 16,285 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
60,072 KB
testcase_01 AC 123 ms
55,736 KB
testcase_02 AC 122 ms
55,776 KB
testcase_03 AC 132 ms
56,008 KB
testcase_04 AC 162 ms
56,340 KB
testcase_05 AC 180 ms
55,768 KB
testcase_06 AC 178 ms
55,712 KB
testcase_07 AC 186 ms
55,932 KB
testcase_08 AC 604 ms
65,552 KB
testcase_09 AC 710 ms
66,380 KB
testcase_10 AC 667 ms
65,368 KB
testcase_11 AC 971 ms
65,364 KB
testcase_12 AC 863 ms
65,532 KB
testcase_13 AC 124 ms
55,564 KB
testcase_14 AC 1,011 ms
66,124 KB
testcase_15 AC 793 ms
66,104 KB
testcase_16 AC 976 ms
68,092 KB
testcase_17 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int i = 0;
        while(i < s.length()){
            if(i == s.length()-1){
                System.out.print(s.charAt(i));
                break;
            }
            else if(s.charAt(i) != s.charAt(i+1)){
                System.out.print(s.charAt(i));
                i++;
            }
            else{
                System.out.print(s.charAt(i));
                i += 2;
             }
        }
        System.out.println();
    }
}
0