結果

問題 No.1469 programing
ユーザー Kome_soudouKome_soudou
提出日時 2021-12-24 19:39:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 154 ms / 3,000 ms
コード長 431 bytes
コンパイル時間 1,854 ms
コンパイル使用メモリ 171,532 KB
実行使用メモリ 12,788 KB
最終ジャッジ日時 2023-10-19 22:38:00
合計ジャッジ時間 4,624 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 6 ms
4,348 KB
testcase_09 AC 7 ms
4,348 KB
testcase_10 AC 7 ms
4,348 KB
testcase_11 AC 10 ms
4,348 KB
testcase_12 AC 9 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 14 ms
4,348 KB
testcase_15 AC 11 ms
4,348 KB
testcase_16 AC 18 ms
4,372 KB
testcase_17 AC 154 ms
12,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string S;
    cin >> S;
    
    deque<char> dq;
    for(int i = 0; i < S.size(); i++)
    {
        if(dq.size() == 0) dq.push_back(S.at(i));
        else
        {
            if(dq.back() != S.at(i)) dq.push_back(S.at(i));
        }
    }
    
    while(!dq.empty())
    {
        cout << dq.front();
        dq.pop_front();
    }
    cout << endl;
    return 0;
}
0