結果

問題 No.1650 Moving Coins
ユーザー 👑 kakel-sankakel-san
提出日時 2024-01-14 09:14:40
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 208 ms / 2,000 ms
コード長 1,028 bytes
コンパイル時間 13,050 ms
コンパイル使用メモリ 157,488 KB
実行使用メモリ 210,140 KB
最終ジャッジ日時 2024-01-14 09:15:04
合計ジャッジ時間 23,949 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
32,804 KB
testcase_01 AC 71 ms
32,676 KB
testcase_02 AC 71 ms
32,804 KB
testcase_03 AC 115 ms
45,384 KB
testcase_04 AC 100 ms
43,536 KB
testcase_05 AC 131 ms
44,816 KB
testcase_06 AC 109 ms
45,576 KB
testcase_07 AC 109 ms
45,652 KB
testcase_08 AC 150 ms
65,824 KB
testcase_09 AC 152 ms
65,232 KB
testcase_10 AC 155 ms
67,108 KB
testcase_11 AC 155 ms
67,672 KB
testcase_12 AC 139 ms
55,808 KB
testcase_13 AC 139 ms
53,244 KB
testcase_14 AC 201 ms
52,700 KB
testcase_15 AC 147 ms
49,444 KB
testcase_16 AC 158 ms
69,180 KB
testcase_17 AC 158 ms
69,164 KB
testcase_18 AC 167 ms
70,308 KB
testcase_19 AC 185 ms
76,036 KB
testcase_20 AC 202 ms
80,320 KB
testcase_21 AC 205 ms
80,440 KB
testcase_22 AC 182 ms
74,824 KB
testcase_23 AC 208 ms
74,824 KB
testcase_24 AC 109 ms
45,680 KB
testcase_25 AC 109 ms
45,696 KB
testcase_26 AC 136 ms
210,140 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (102 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.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 int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = NN;
        var a = NList;
        var b = NList;
        var ans = new List<string>();
        for (var i = 0; i < n; ++i)
        {
            while (a[i] > b[i])
            {
                ans.Add($"{i + 1} L");
                --a[i];
            }
        }
        for (var i = n - 1; i >= 0; --i)
        {
            while (a[i] < b[i])
            {
                ans.Add($"{i + 1} R");
                ++a[i];
            }
        }
        WriteLine(ans.Count);
        if (ans.Count > 0) WriteLine(string.Join("\n", ans));
    }
}
0