結果
問題 | No.1934 Four Fruits |
ユーザー | ccc |
提出日時 | 2022-09-01 14:15:50 |
言語 | C# (.NET 7.0.402) |
結果 |
AC
|
実行時間 | 64 ms / 2,000 ms |
コード長 | 872 bytes |
コンパイル時間 | 7,633 ms |
コンパイル使用メモリ | 144,168 KB |
実行使用メモリ | 162,392 KB |
最終ジャッジ日時 | 2023-08-09 00:18:17 |
合計ジャッジ時間 | 9,149 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 59 ms
28,956 KB |
testcase_01 | AC | 59 ms
29,080 KB |
testcase_02 | AC | 64 ms
31,068 KB |
testcase_03 | AC | 63 ms
29,040 KB |
testcase_04 | AC | 58 ms
29,040 KB |
testcase_05 | AC | 50 ms
30,416 KB |
testcase_06 | AC | 50 ms
28,656 KB |
testcase_07 | AC | 50 ms
28,556 KB |
testcase_08 | AC | 64 ms
31,184 KB |
testcase_09 | AC | 59 ms
162,392 KB |
コンパイルメッセージ
Determining projects to restore... Restored /home/judge/data/code/main.csproj (in 118 ms). .NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f Copyright (C) Microsoft Corporation.All rights reserved. プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください main -> /home/judge/data/code/bin/Release/net6.0/main.dll main -> /home/judge/data/code/bin/Release/net6.0/publish/
ソースコード
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 || b == c || 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 = abcd.Except(abc).ToList(); Console.WriteLine(String.Join("",result)); } } }