結果

問題 No.1469 programing
ユーザー KFrom40KFrom40
提出日時 2021-04-15 21:11:48
言語 PHP
(8.3.4)
結果
AC  
実行時間 311 ms / 3,000 ms
コード長 544 bytes
コンパイル時間 1,149 ms
コンパイル使用メモリ 18,640 KB
実行使用メモリ 30,544 KB
最終ジャッジ日時 2023-09-14 23:09:52
合計ジャッジ時間 3,540 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,852 KB
testcase_01 AC 16 ms
18,760 KB
testcase_02 AC 15 ms
18,808 KB
testcase_03 AC 15 ms
18,832 KB
testcase_04 AC 16 ms
18,704 KB
testcase_05 AC 16 ms
18,748 KB
testcase_06 AC 15 ms
18,832 KB
testcase_07 AC 16 ms
18,760 KB
testcase_08 AC 23 ms
18,744 KB
testcase_09 AC 26 ms
18,748 KB
testcase_10 AC 25 ms
18,704 KB
testcase_11 AC 33 ms
18,772 KB
testcase_12 AC 28 ms
18,740 KB
testcase_13 AC 16 ms
18,744 KB
testcase_14 AC 39 ms
18,820 KB
testcase_15 AC 34 ms
18,824 KB
testcase_16 AC 45 ms
18,792 KB
testcase_17 AC 311 ms
30,544 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
//[$n,$m] = array_map('intval', explode(' ', trim(fgets(STDIN))));
//[$n] = array_map('intval', explode(' ', trim(fgets(STDIN))));
//$a = array_map('intval', explode(' ', trim(fgets(STDIN))));
//[$s,$t] = explode(' ', trim(fgets(STDIN)));
[$s] = explode(' ', trim(fgets(STDIN)));
//$s = explode(' ', trim(fgets(STDIN)));
//function decr($v){return --$v;}
//alpha='abcdefghijklmnopqrstuvwxyz';

$len=strlen($s);
$ans = "";

for($i=0;$i<$len-1;$i++){
    if($s[$i]==$s[$i+1]) continue;
    $ans .= $s[$i];
}
$ans .= $s[$len-1];

echo $ans;
0