結果

問題 No.1837 Same but Different
ユーザー 👑 kakel-sankakel-san
提出日時 2022-02-11 22:19:29
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 875 bytes
コンパイル時間 2,460 ms
コンパイル使用メモリ 65,656 KB
実行使用メモリ 24,940 KB
最終ジャッジ日時 2023-09-10 03:45:20
合計ジャッジ時間 5,658 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,680 KB
testcase_01 AC 57 ms
22,660 KB
testcase_02 WA -
testcase_03 AC 57 ms
20,644 KB
testcase_04 WA -
testcase_05 AC 57 ms
20,616 KB
testcase_06 AC 58 ms
20,748 KB
testcase_07 WA -
testcase_08 AC 58 ms
20,768 KB
testcase_09 AC 60 ms
20,732 KB
testcase_10 WA -
testcase_11 AC 57 ms
20,760 KB
testcase_12 AC 57 ms
22,636 KB
testcase_13 WA -
testcase_14 AC 60 ms
20,756 KB
testcase_15 AC 58 ms
20,720 KB
testcase_16 WA -
testcase_17 AC 57 ms
20,760 KB
testcase_18 AC 57 ms
20,620 KB
testcase_19 AC 57 ms
22,784 KB
testcase_20 WA -
testcase_21 AC 57 ms
20,700 KB
testcase_22 WA -
testcase_23 AC 57 ms
20,824 KB
権限があれば一括ダウンロードができます

ソースコード

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 void Main()
    {
        var n = NN;
        var a = new int[n];
        var b = new int[n];
        for (var i = 0; i < n; ++i)
        {
            a[i] = 3 * i;
            b[i] = 3 * i + 1;
        }
        var rest = n;
        for (var i = n - 1; i >= 0; --i)
        {
            if (rest < 3) break;
            a[i] += 3;
            rest -= 3;
        }
        for (var i = n - 1; i >= 0; --i)
        {
            if (rest == 0) break;
            a[i] += 1;
            rest -= 1;
        }
        WriteLine(string.Join(" ", a));
        WriteLine(string.Join(" ", b));
    }
}
0