結果

問題 No.587 七対子
ユーザー NoNo
提出日時 2018-01-19 00:47:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 686 bytes
コンパイル時間 2,756 ms
コンパイル使用メモリ 104,492 KB
実行使用メモリ 23,364 KB
最終ジャッジ日時 2023-09-27 02:18:54
合計ジャッジ時間 5,176 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
21,240 KB
testcase_01 AC 50 ms
23,272 KB
testcase_02 AC 50 ms
21,340 KB
testcase_03 AC 49 ms
19,180 KB
testcase_04 AC 50 ms
21,236 KB
testcase_05 AC 49 ms
21,344 KB
testcase_06 AC 51 ms
21,236 KB
testcase_07 AC 50 ms
21,172 KB
testcase_08 AC 50 ms
23,304 KB
testcase_09 AC 49 ms
21,300 KB
testcase_10 AC 50 ms
21,432 KB
testcase_11 AC 50 ms
21,388 KB
testcase_12 AC 50 ms
19,100 KB
testcase_13 AC 50 ms
21,220 KB
testcase_14 AC 50 ms
21,132 KB
testcase_15 AC 51 ms
23,284 KB
testcase_16 AC 50 ms
21,132 KB
testcase_17 AC 50 ms
19,268 KB
testcase_18 AC 49 ms
21,136 KB
testcase_19 AC 50 ms
21,492 KB
testcase_20 AC 51 ms
23,184 KB
testcase_21 AC 49 ms
19,264 KB
testcase_22 AC 50 ms
21,240 KB
testcase_23 AC 50 ms
21,224 KB
testcase_24 AC 50 ms
21,276 KB
testcase_25 AC 50 ms
19,176 KB
testcase_26 AC 51 ms
21,128 KB
testcase_27 AC 50 ms
21,328 KB
testcase_28 AC 51 ms
23,364 KB
testcase_29 AC 51 ms
21,132 KB
testcase_30 AC 50 ms
23,328 KB
testcase_31 AC 50 ms
21,340 KB
testcase_32 AC 50 ms
21,132 KB
testcase_33 AC 50 ms
23,320 KB
testcase_34 AC 50 ms
21,200 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.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string ans = "";
            bool f = true;

            foreach (var c in s)
            {
                int a = s.Count(x => x == c);
                if (a > 2)
                {
                    f = false;
                    break;
                }
                if (a == 1)
                {
                    ans += c.ToString();
                }
            }

            if (!f || ans.Length >= 2) Console.WriteLine("Impossible");
            else Console.WriteLine(ans);
        }
    }
}
0