結果

問題 No.587 七対子
ユーザー mbanmban
提出日時 2017-12-01 17:42:39
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 2,075 bytes
コンパイル時間 2,196 ms
コンパイル使用メモリ 104,428 KB
実行使用メモリ 22,712 KB
最終ジャッジ日時 2023-08-18 15:20:49
合計ジャッジ時間 5,435 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 50 ms
20,720 KB
testcase_02 AC 50 ms
22,708 KB
testcase_03 AC 49 ms
20,576 KB
testcase_04 AC 51 ms
22,600 KB
testcase_05 AC 50 ms
22,616 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 50 ms
20,584 KB
testcase_10 AC 49 ms
20,536 KB
testcase_11 WA -
testcase_12 AC 49 ms
20,576 KB
testcase_13 AC 50 ms
20,716 KB
testcase_14 AC 50 ms
20,628 KB
testcase_15 WA -
testcase_16 AC 51 ms
20,620 KB
testcase_17 AC 50 ms
20,476 KB
testcase_18 AC 49 ms
20,616 KB
testcase_19 WA -
testcase_20 AC 50 ms
20,616 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 49 ms
20,604 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 50 ms
22,464 KB
testcase_30 AC 50 ms
20,676 KB
testcase_31 WA -
testcase_32 AC 49 ms
20,624 KB
testcase_33 AC 50 ms
20,704 KB
testcase_34 AC 50 ms
22,592 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Scanner
{
    private readonly char Separator = ' ';
    private int Index = 0;
    private string[] Line = new string[0];
    public string Next()
    {
        if (Index >= Line.Length)
        {
            Line = Console.ReadLine().Split(Separator);
            Index = 0;
        }
        var ret = Line[Index];
        Index++;
        return ret;
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public string[] StringArray()
    {
        Line = Console.ReadLine().Split(Separator);
        Index = Line.Length;
        return Line;
    }

    public int[] IntArray()
    {
        var l = StringArray();
        var res = new int[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = int.Parse(l[i]);
        }
        return res;
    }

    public long[] LongArray()
    {
        var l = StringArray();
        var res = new long[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = long.Parse(l[i]);
        }
        return res;
    }
}
class Program
{
    private string S;
    private void Scan()
    {
        var sc = new Scanner();
        S = sc.Next();
    }

    public void Solve()
    {
        Scan();
        var cnt = new int[200];
        foreach (char c in S)
        {
            cnt[c]++;
        }
        int one = 0;
        string s = "";
        for (char c = 'a'; c <= 'z'; c++)
        {
            var i = cnt[c];
            switch (i)
            {
                case 1:
                    s = c.ToString();
                    one++;
                    break;
                case 3:
                    Console.WriteLine("Impossible");
                    return;
            }
        }
        Console.WriteLine(one == 1 ? s : "Impossoble");
    }

    static void Main(string[] args)
    {
        new Program().Solve();
    }
}
0