結果

問題 No.118 門松列(2)
ユーザー しらゆきしらゆき
提出日時 2016-01-10 13:22:43
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 1,985 bytes
コンパイル時間 3,865 ms
コンパイル使用メモリ 104,320 KB
実行使用メモリ 24,960 KB
最終ジャッジ日時 2024-04-17 13:34:27
合計ジャッジ時間 4,412 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
19,712 KB
testcase_01 AC 58 ms
24,948 KB
testcase_02 AC 56 ms
24,768 KB
testcase_03 AC 59 ms
24,844 KB
testcase_04 AC 59 ms
24,668 KB
testcase_05 AC 60 ms
24,960 KB
testcase_06 AC 30 ms
18,816 KB
testcase_07 AC 31 ms
18,816 KB
testcase_08 AC 29 ms
18,816 KB
testcase_09 AC 59 ms
24,736 KB
testcase_10 AC 41 ms
20,608 KB
testcase_11 AC 42 ms
21,120 KB
testcase_12 AC 39 ms
20,608 KB
testcase_13 AC 37 ms
19,840 KB
testcase_14 AC 57 ms
24,540 KB
testcase_15 AC 33 ms
19,584 KB
testcase_16 AC 45 ms
22,656 KB
testcase_17 AC 36 ms
19,712 KB
testcase_18 AC 39 ms
20,992 KB
testcase_19 AC 46 ms
22,400 KB
testcase_20 AC 47 ms
22,400 KB
testcase_21 AC 55 ms
23,552 KB
testcase_22 AC 41 ms
20,608 KB
testcase_23 AC 52 ms
23,240 KB
testcase_24 AC 41 ms
21,376 KB
testcase_25 AC 44 ms
21,632 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.Linq;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        var n = rl();
        var a = ria();
        long mod = 1000000007;

        var cnt = new long[100];
        for (int i = 0; i < n; i++)
            cnt[a[i] - 1]++;

        long ans = 0;

        for (int i = 0; i < 100; i++)
        {
            for(int j = i + 1; j < 100; j++)
            {
                for(int k = j + 1; k < 100; k++)
                {
                    ans += cnt[i] * cnt[j] * cnt[k] % mod;
                    ans = ans % mod;
                }
            }
        }

        Console.WriteLine(ans);
    }

    #region Scan
    static int ri() { return int.Parse(Console.ReadLine()); }
    static long rl() { return long.Parse(Console.ReadLine()); }
    static double rd() { return double.Parse(Console.ReadLine()); }
    static string rs() { return Console.ReadLine(); }
    static int[] ria() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); }
    static long[] rla() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); }
    static double[] rda() { return Console.ReadLine().Trim().Split().Select(double.Parse).ToArray(); }
    static string[] rsa() { return Console.ReadLine().Trim().Split(); }
    static void mul(out int a, out int b) { var arr = ria(); a = arr[0]; b = arr[1]; }
    static void mul(out int a, out int b, out int c) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; }
    static void mul(out int a, out int b, out int c, out int d) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    static void mul(out long a, out long b) { var arr = rla(); a = arr[0]; b = arr[1]; }
    static void mul(out long a, out long b, out long c) { var arr = rla(); a = arr[0]; b = arr[1]; c = arr[2]; }
    static void mul(out long a, out long b, out long c, out long d) { var arr = rla(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    #endregion
}
0