提出 #68838227


ソースコード 拡げる

n = int(input())
ch = [() for _ in range(n)]
c1 = []
c2 = []
for i in range(n):
    s, t = map(int, input().split())
    ch[i] = (s, t)
    if s < t:
        c1.append((s, i))
    else:
        c2.append((s, i))
ch.sort()
for i in range(n - 1):
    if ch[i][1] > ch[i + 1][1]:
        print("No")
        exit()
c1.sort(reverse=True)
c2.sort()
ans = []
for s, i in c1:
    ans.append(i + 1)
for s, i in c2:
    ans.append(i + 1)
print("Yes")
print(*ans)

提出情報

提出日時
問題 C - No Collision Moves
ユーザ sounansya
言語 Python (PyPy 3.10-v7.3.12)
得点 600
コード長 477 Byte
結果 AC
実行時間 727 ms
メモリ 124816 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 600 / 600
結果
AC × 3
AC × 27
セット名 テストケース
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_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 56 ms 76380 KiB
00_sample_01.txt AC 56 ms 76360 KiB
00_sample_02.txt AC 55 ms 76784 KiB
01_handmade_00.txt AC 56 ms 76712 KiB
01_handmade_01.txt AC 56 ms 76528 KiB
01_handmade_02.txt AC 727 ms 123900 KiB
01_handmade_03.txt AC 727 ms 123828 KiB
01_handmade_04.txt AC 709 ms 124024 KiB
01_handmade_05.txt AC 432 ms 102008 KiB
01_handmade_06.txt AC 704 ms 123804 KiB
01_handmade_07.txt AC 711 ms 123584 KiB
02_random_00.txt AC 392 ms 100348 KiB
02_random_01.txt AC 116 ms 85108 KiB
02_random_02.txt AC 198 ms 90324 KiB
02_random_03.txt AC 421 ms 101236 KiB
02_random_04.txt AC 425 ms 101532 KiB
02_random_05.txt AC 422 ms 101760 KiB
02_random_06.txt AC 421 ms 101856 KiB
02_random_07.txt AC 427 ms 101716 KiB
02_random_08.txt AC 231 ms 92548 KiB
02_random_09.txt AC 163 ms 87792 KiB
02_random_10.txt AC 620 ms 120128 KiB
02_random_11.txt AC 449 ms 107068 KiB
02_random_12.txt AC 715 ms 120620 KiB
02_random_13.txt AC 710 ms 123660 KiB
02_random_14.txt AC 710 ms 123972 KiB
02_random_15.txt AC 718 ms 124816 KiB