結果

問題 No.1519 Diversity
ユーザー 👑 kakel-sankakel-san
提出日時 2024-06-02 19:39:35
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 770 bytes
コンパイル時間 18,758 ms
コンパイル使用メモリ 167,360 KB
実行使用メモリ 195,900 KB
最終ジャッジ日時 2024-06-02 19:39:57
合計ジャッジ時間 12,914 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
30,592 KB
testcase_01 AC 48 ms
29,440 KB
testcase_02 AC 55 ms
30,848 KB
testcase_03 AC 74 ms
34,816 KB
testcase_04 AC 86 ms
39,168 KB
testcase_05 AC 53 ms
30,592 KB
testcase_06 AC 85 ms
41,472 KB
testcase_07 AC 54 ms
30,720 KB
testcase_08 AC 59 ms
32,128 KB
testcase_09 AC 100 ms
35,304 KB
testcase_10 AC 81 ms
38,912 KB
testcase_11 AC 55 ms
30,592 KB
testcase_12 AC 88 ms
41,192 KB
testcase_13 AC 85 ms
41,600 KB
testcase_14 AC 84 ms
41,584 KB
testcase_15 AC 84 ms
195,900 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (89 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    static long[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = NN;
        var ans = new List<int[]>();
        for (var i = 1; i < n; ++i)
        {
            for (var j = i + 1; j < n - i + 1; ++j) ans.Add(new int[] { i, j });
        }
        WriteLine(ans.Count);
        if (ans.Count > 0) WriteLine(string.Join("\n", ans.Select(ai => string.Join(" ", ai))));
    }
}
0