結果

問題 No.1934 Four Fruits
ユーザー cccccc
提出日時 2022-09-01 14:12:33
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 861 bytes
コンパイル時間 7,978 ms
コンパイル使用メモリ 166,752 KB
実行使用メモリ 185,824 KB
最終ジャッジ日時 2024-04-26 16:17:04
合計ジャッジ時間 9,677 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 64 ms
30,976 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 56 ms
30,336 KB
testcase_06 AC 56 ms
30,208 KB
testcase_07 AC 56 ms
30,080 KB
testcase_08 AC 63 ms
31,232 KB
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (93 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;


class Program
{
    static void Main()
    {
        var abc = Console.ReadLine().Split().Select(int.Parse).ToList();
        var a = abc[0];
        var b = abc[1];
        var c = abc[2];

        if (a == b && b == c) 
        {
            Console.WriteLine(a);
        }
        else if(a == b || a == c)
        {
            var duplicates = abc.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList();
            var result = abc.Except(duplicates).ToList();
            Console.WriteLine(String.Join("",result));
        }
        else if(a != b && b != c)
        {
            int[] abcd = {0, 1, 2, 3};
            var result = abc.Except(abcd).ToList();
            Console.WriteLine(String.Join("",result));
        }
    }
}
0