結果

問題 No.2482 Sandglasses
ユーザー 👑 kakel-sankakel-san
提出日時 2023-09-25 22:07:19
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 346 ms / 2,000 ms
コード長 1,258 bytes
コンパイル時間 2,343 ms
コンパイル使用メモリ 111,748 KB
実行使用メモリ 58,788 KB
最終ジャッジ日時 2023-11-29 10:59:24
合計ジャッジ時間 16,070 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
25,856 KB
testcase_01 AC 32 ms
25,856 KB
testcase_02 AC 32 ms
25,856 KB
testcase_03 AC 334 ms
58,744 KB
testcase_04 AC 337 ms
58,744 KB
testcase_05 AC 331 ms
58,744 KB
testcase_06 AC 335 ms
58,744 KB
testcase_07 AC 331 ms
58,744 KB
testcase_08 AC 327 ms
58,744 KB
testcase_09 AC 338 ms
58,744 KB
testcase_10 AC 334 ms
58,744 KB
testcase_11 AC 337 ms
58,744 KB
testcase_12 AC 341 ms
58,744 KB
testcase_13 AC 336 ms
58,744 KB
testcase_14 AC 329 ms
58,744 KB
testcase_15 AC 330 ms
58,744 KB
testcase_16 AC 331 ms
58,744 KB
testcase_17 AC 334 ms
58,744 KB
testcase_18 AC 331 ms
58,744 KB
testcase_19 AC 346 ms
58,744 KB
testcase_20 AC 344 ms
58,744 KB
testcase_21 AC 336 ms
58,744 KB
testcase_22 AC 337 ms
58,744 KB
testcase_23 AC 328 ms
58,788 KB
testcase_24 AC 308 ms
58,788 KB
testcase_25 AC 329 ms
58,788 KB
testcase_26 AC 309 ms
58,788 KB
testcase_27 AC 331 ms
58,788 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 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();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (n, k, t) = (c[0], c[1], c[2]);
        var a = ReadLine().Split();
        var b = NList;
        var clocks = new List<(int id, int dir, int pos)>(n);
        for (var i = 0; i < n; ++i)
        {
            clocks.Add((i, a[i] == "A" ? -1 : 1, b[i]));
        }
        clocks.Sort((l, r) => l.pos.CompareTo(r.pos));
        var after = new List<int>(n);
        for (var i = 0; i < n; ++i)
        {
            after.Add(GetPos(clocks[i].pos, clocks[i].dir, k, t));
        }
        after.Sort();
        var ans = new int[n];
        for (var i = 0; i < n; ++i) ans[clocks[i].id] = after[i];
        WriteLine(string.Join(" ", ans));
    }
    static int GetPos(int begin, int dir, int len, int time)
    {
        var after = Math.Abs((begin + dir * time) % (len * 2));
        if (after > len) return 2 * len - after;
        else return after;
    }
}
0