結果

問題 No.1469 programing
ユーザー itt828itt828
提出日時 2021-04-09 21:24:57
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 115 ms / 3,000 ms
コード長 5,099 bytes
コンパイル時間 2,324 ms
コンパイル使用メモリ 117,584 KB
実行使用メモリ 51,256 KB
最終ジャッジ日時 2024-06-25 04:02:23
合計ジャッジ時間 3,294 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
18,944 KB
testcase_01 AC 28 ms
18,816 KB
testcase_02 AC 26 ms
18,944 KB
testcase_03 AC 28 ms
18,816 KB
testcase_04 AC 28 ms
18,944 KB
testcase_05 AC 28 ms
18,944 KB
testcase_06 AC 27 ms
18,816 KB
testcase_07 AC 28 ms
18,944 KB
testcase_08 AC 30 ms
19,456 KB
testcase_09 AC 31 ms
19,840 KB
testcase_10 AC 31 ms
19,584 KB
testcase_11 AC 34 ms
21,120 KB
testcase_12 AC 32 ms
20,480 KB
testcase_13 AC 28 ms
18,944 KB
testcase_14 AC 36 ms
22,272 KB
testcase_15 AC 34 ms
21,120 KB
testcase_16 AC 37 ms
22,272 KB
testcase_17 AC 115 ms
51,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

#region itumono
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using static System.Math;
using static Output;
using static Consts;
#region I/O
public static class Output
{

    public static void Put(string a) => Console.WriteLine(a);
    public static void Put(params object[] i) => Put(string.Join(" ", i));
    public static void Put<T>(IEnumerable<T> a) => Put(string.Join(" ", a));
    public static void PutV<T>(IEnumerable<T> a) { foreach (var z in a) Put(z); }
    public static void YN(bool i) { if (i) Put("Yes"); else Put("No"); }
}
public class Input
{
    public static string Str => Console.ReadLine();
    public static bool IsTypeEqual<T, U>() => typeof(T).Equals(typeof(U));
    public static T ConvertType<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
    public static T Cast<T>(string s)
    {
        if (IsTypeEqual<T, int>()) return ConvertType<T, int>(int.Parse(s));
        else if (IsTypeEqual<T, long>()) return ConvertType<T, long>(long.Parse(s));
        else if (IsTypeEqual<T, double>()) return ConvertType<T, double>(double.Parse(s));
        else if (IsTypeEqual<T, char>()) return ConvertType<T, char>(char.Parse(s));
        else if (IsTypeEqual<T, BigInteger>()) return ConvertType<T, BigInteger>(BigInteger.Parse(s));
        else if (IsTypeEqual<T, decimal>()) return ConvertType<T, decimal>(decimal.Parse(s));
        else return ConvertType<T, string>(s);
    }
    public static T[] Castarr<T>(string[] s)
    {

        var ret = new T[s.Length];
        int i = 0;
        if (IsTypeEqual<T, char>())
        {
            var list = new List<T>();
            foreach (var t in s)
            {
                foreach (var u in t)
                {
                    list.Add(ConvertType<T, char>(char.Parse(u.ToString())));
                }
            }
            return list.ToArray();
        }
        foreach (var t in s)
        {
            if (IsTypeEqual<T, int>()) ret[i++] = ConvertType<T, int>(int.Parse(t));
            else if (IsTypeEqual<T, long>()) ret[i++] = ConvertType<T, long>(long.Parse(t));
            else if (IsTypeEqual<T, double>()) ret[i++] = ConvertType<T, double>(double.Parse(t));
            else if (IsTypeEqual<T, BigInteger>()) ret[i++] = ConvertType<T, BigInteger>(BigInteger.Parse(t));
            else ret[i++] = ConvertType<T, string>(t);
        }
        return ret;
    }
    Queue<string> q = new Queue<string>();
    void next() { var ss = Str.Split(' '); foreach (var item in ss) q.Enqueue(item); }
    public T cin<T>() { if (!q.Any()) next(); return Cast<T>(q.Dequeue()); }
    public T[] cinarr<T>() { return Castarr<T>(Str.Split(' ')); }
    public T[] cinarr<T>(int n) { var ret = new T[n]; for (int i = 0; i < n; ++i) ret[i] = cin<T>(); return ret; }
    public int Int => cin<int>();
    public long Long => cin<long>();
    public double Double => cin<double>();
    public char Char => cin<char>();
    public string String => cin<string>();
    public BigInteger BI => cin<BigInteger>();
    public int[] Intarr => cinarr<int>();
    public long[] Longarr => cinarr<long>();
    public double[] Doublearr => cinarr<double>();
    public char[] Chararr => cinarr<char>();
    public string[] Stringarr => cinarr<string>();
    public BigInteger[] BIarr => cinarr<BigInteger>();
    public void cin<T>(out T t) { t = cin<T>(); }
    public void mul<T, U>(out T t, out U u) { t = cin<T>(); u = cin<U>(); }
    public void mul<T, U, V>(out T t, out U u, out V v) { t = cin<T>(); u = cin<U>(); v = cin<V>(); }
    public void mul<T, U, V, W>(out T t, out U u, out V v, out W w) { t = cin<T>(); u = cin<U>(); v = cin<V>(); w = cin<W>(); }
    public void mul<T, U, V, W, X>(out T t, out U u, out V v, out W w, out X x) { t = cin<T>(); u = cin<U>(); v = cin<V>(); w = cin<W>(); x = cin<X>(); }
    public void mul<T, U, V, W, X, Y>(out T t, out U u, out V v, out W w, out X x, out Y y) { t = cin<T>(); u = cin<U>(); v = cin<V>(); w = cin<W>(); x = cin<X>(); y = cin<Y>(); }
    public void mul<T, U, V, W, X, Y, Z>(out T t, out U u, out V v, out W w, out X x, out Y y, out Z z) { t = cin<T>(); u = cin<U>(); v = cin<V>(); w = cin<W>(); x = cin<X>(); y = cin<Y>(); z = cin<Z>(); }
}

#endregion
class Program
{
    static void Main(string[] args)
    {
        var CP = new CP();
        CP.Solve();
    }
}
#endregion itumono
public static class Consts
{
    public const int INF = 1 << 30;
    //public const long INF = 1L << 60;
    public const int MOD = 1000000007;
    //public const int MOD = 998244353;
}

public class CP
{
    Input cin = new Input();
    public void Solve()
    {
        var S = cin.String;
        var T = new List<char>();
        for (int i = 0; i < S.Length; ++i)
        {
            if (i != S.Length - 1 && S[i] == S[i + 1])
            {
                T.Add(S[i]);
                ++i;
            }
            else T.Add(S[i]);
        }
        Put(new string(T.ToArray()));
    }
}
0