結果

問題 No.1519 Diversity
ユーザー 👑 kakel-sankakel-san
提出日時 2024-06-02 19:34:23
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 751 bytes
コンパイル時間 7,029 ms
コンパイル使用メモリ 169,788 KB
実行使用メモリ 198,540 KB
最終ジャッジ日時 2024-06-02 19:34:36
合計ジャッジ時間 9,736 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
30,976 KB
testcase_01 WA -
testcase_02 AC 50 ms
30,816 KB
testcase_03 AC 66 ms
34,944 KB
testcase_04 AC 73 ms
39,296 KB
testcase_05 AC 50 ms
30,720 KB
testcase_06 AC 79 ms
41,472 KB
testcase_07 AC 50 ms
30,720 KB
testcase_08 AC 52 ms
31,872 KB
testcase_09 AC 66 ms
35,200 KB
testcase_10 AC 72 ms
38,912 KB
testcase_11 AC 49 ms
30,720 KB
testcase_12 AC 79 ms
40,960 KB
testcase_13 AC 79 ms
41,472 KB
testcase_14 AC 78 ms
41,728 KB
testcase_15 AC 81 ms
198,540 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (106 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);
        WriteLine(string.Join("\n", ans.Select(ai => string.Join(" ", ai))));
    }
}
0