提出 #57283794


ソースコード 拡げる

import os; LOCAL = "INSIDE_EMACS" in os.environ
I = input; II, FL = lambda: int(I()), lambda: map(int, I().split()); FLL = lambda: [*FL()]
DEC, INC, YN = lambda x: x-1, lambda x: x+1, lambda y: print('YES' if y else 'NO')
R, E, S, P, L, F, RV, INF = range, enumerate, sorted, print, len, filter, reversed, float('inf')

def solve():
    h = [[], []]
    for _ in R(II()):
        s = I().split()
        h[s[1]=='R'] += int(s[0]),
    P(sum(abs(lst[i] - lst[i-1]) for lst in h for i in R(1, len(lst))))

if LOCAL: [solve() for _ in R(II())]
else: solve()

提出情報

提出日時
問題 B - Piano 3
ユーザ wsaleem
言語 Python (PyPy 3.10-v7.3.12)
得点 200
コード長 569 Byte
結果 AC
実行時間 57 ms
メモリ 76832 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 20
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 02_handmade_00.txt, 02_handmade_01.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 56 ms 76492 KiB
00_sample_01.txt AC 56 ms 76560 KiB
00_sample_02.txt AC 55 ms 76720 KiB
01_random_00.txt AC 55 ms 76832 KiB
01_random_01.txt AC 55 ms 76456 KiB
01_random_02.txt AC 56 ms 76508 KiB
01_random_03.txt AC 55 ms 76412 KiB
01_random_04.txt AC 56 ms 76828 KiB
01_random_05.txt AC 56 ms 76536 KiB
01_random_06.txt AC 55 ms 76688 KiB
01_random_07.txt AC 56 ms 76628 KiB
01_random_08.txt AC 55 ms 76624 KiB
01_random_09.txt AC 56 ms 76828 KiB
01_random_10.txt AC 56 ms 76492 KiB
01_random_11.txt AC 56 ms 76700 KiB
01_random_12.txt AC 57 ms 76468 KiB
01_random_13.txt AC 56 ms 76724 KiB
01_random_14.txt AC 55 ms 76588 KiB
02_handmade_00.txt AC 56 ms 76372 KiB
02_handmade_01.txt AC 57 ms 76504 KiB