結果

問題 No.1469 programing
ユーザー tentententen
提出日時 2021-04-13 12:47:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 278 ms / 3,000 ms
コード長 1,005 bytes
コンパイル時間 1,976 ms
コンパイル使用メモリ 72,696 KB
実行使用メモリ 78,240 KB
最終ジャッジ日時 2023-09-12 00:19:02
合計ジャッジ時間 4,965 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,512 KB
testcase_01 AC 41 ms
49,408 KB
testcase_02 AC 42 ms
49,504 KB
testcase_03 AC 43 ms
49,408 KB
testcase_04 AC 45 ms
49,272 KB
testcase_05 AC 46 ms
49,272 KB
testcase_06 AC 46 ms
49,340 KB
testcase_07 AC 45 ms
49,412 KB
testcase_08 AC 99 ms
52,184 KB
testcase_09 AC 108 ms
52,656 KB
testcase_10 AC 102 ms
50,572 KB
testcase_11 AC 124 ms
54,336 KB
testcase_12 AC 112 ms
54,604 KB
testcase_13 AC 43 ms
49,364 KB
testcase_14 AC 143 ms
55,680 KB
testcase_15 AC 126 ms
54,784 KB
testcase_16 AC 157 ms
55,172 KB
testcase_17 AC 278 ms
78,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        StringBuilder sb = new StringBuilder();
        char prev = ' ';
        for (char c : sc.next().toCharArray()) {
            if (c != prev) {
                sb.append(c);
            }
            prev = c;
        }
        System.out.println(sb);
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public String next() throws Exception {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0