結果
問題 | No.412 花火大会 |
ユーザー | sekiya9311 |
提出日時 | 2016-10-28 09:27:05 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,308 bytes |
コンパイル時間 | 982 ms |
コンパイル使用メモリ | 113,152 KB |
実行使用メモリ | 26,488 KB |
最終ジャッジ日時 | 2024-05-03 07:10:23 |
合計ジャッジ時間 | 2,471 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 24 ms
24,364 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 25 ms
24,108 KB |
testcase_09 | AC | 24 ms
24,108 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 24 ms
24,116 KB |
testcase_17 | AC | 23 ms
24,320 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 25 ms
26,220 KB |
testcase_21 | WA | - |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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); 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)); } }