結果

問題 No.45 回転寿司
ユーザー nakamura0422nakamura0422
提出日時 2023-01-10 15:17:04
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 723 bytes
コンパイル時間 6,985 ms
コンパイル使用メモリ 147,964 KB
実行使用メモリ 167,100 KB
最終ジャッジ日時 2023-08-23 10:14:11
合計ジャッジ時間 10,482 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 53 ms
28,628 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 53 ms
28,860 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 52 ms
28,848 KB
testcase_32 AC 53 ms
28,640 KB
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  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/

ソースコード

diff #

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

static class ConveyorBeltSushi
{
    static void Main()
    {
    	// 何にも使わない
	    int count = int.Parse(Console.ReadLine());
	    
	    var deliciousness = Console.ReadLine().Split(' ').Select(int.Parse);
	    
	    var sumDeliciousness = deliciousness.Chunk(4).Select(x => {
	    	switch(x.Count()) 
	    	{
	    		case 1:
	    		return x.Max();
	    		case 2:
	    		return x.Max();
	    		case 3:
	    		return Math.Max(x[0] + x[2], x[1]);
	    		case 4:
	    		return Math.Max(x[0] + x[2], x[1] + x[3]);
	    		default:
	    		return 0;
	    	}}).Sum();
	    	
	    	Console.WriteLine(sumDeliciousness);
   }
}
0