結果

問題 No.412 花火大会
ユーザー sekiya9311sekiya9311
提出日時 2016-10-28 09:32:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 1,327 bytes
コンパイル時間 2,350 ms
コンパイル使用メモリ 105,724 KB
実行使用メモリ 23,004 KB
最終ジャッジ日時 2023-08-15 20:31:44
合計ジャッジ時間 4,700 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,636 KB
testcase_01 AC 60 ms
23,004 KB
testcase_02 AC 61 ms
20,648 KB
testcase_03 AC 63 ms
20,768 KB
testcase_04 AC 61 ms
20,684 KB
testcase_05 AC 62 ms
20,704 KB
testcase_06 AC 63 ms
20,588 KB
testcase_07 AC 60 ms
20,644 KB
testcase_08 AC 61 ms
22,784 KB
testcase_09 AC 60 ms
22,708 KB
testcase_10 AC 61 ms
22,800 KB
testcase_11 AC 59 ms
20,764 KB
testcase_12 AC 61 ms
18,612 KB
testcase_13 AC 60 ms
22,704 KB
testcase_14 AC 62 ms
22,704 KB
testcase_15 AC 61 ms
20,884 KB
testcase_16 AC 61 ms
20,696 KB
testcase_17 AC 61 ms
20,840 KB
testcase_18 AC 61 ms
20,780 KB
testcase_19 AC 61 ms
20,776 KB
testcase_20 AC 59 ms
20,752 KB
testcase_21 AC 60 ms
22,716 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.IO;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;

class Template
{
	static Scanner sc;
	public static void Main(string[] args)
	{
		sc = new Scanner();
		var vec = sc.nextLongArray();
		long N = sc.nextLong();
		var E = sc.nextLongArray();
		long[,] dp = new long[N + 1, 4];
		Array.Sort(vec);
		Array.Sort(E);
		dp[0, 0] = 1;
		for (int i = 0; i < N; i++)
		{
			for (int j = 0; j < 4; j++)
			{
				dp[i + 1, j] += dp[i, j];
				if (j != 3 && vec[j] <= E[i])
				{
					dp[i + 1, j + 1] += dp[i, j];
				}
				else
				{
					dp[i + 1, j] += dp[i, j];
				}
			}
		}
		Console.WriteLine(dp[N, 3]);
	}
}

public class Scanner
{
	public Scanner() { }
	public string next()
	{
		return Console.ReadLine();
	}
	public int nextInt()
	{
		return int.Parse(next());
	}
	public double nextDouble()
	{
		return double.Parse(next());
	}
	public long nextLong()
	{
		return long.Parse(next());
	}
	public string[] nextArray()
	{
		return next().Split(' ');
	}
	public int[] nextIntArray()
	{
		return Array.ConvertAll(nextArray(), e => int.Parse(e));
	}
	public long[] nextLongArray()
	{
		return Array.ConvertAll(nextArray(), e => long.Parse(e));
	}
	public double[] nextDoubleArray()
	{
		return Array.ConvertAll(nextArray(), e => double.Parse(e));
	}
}
0