提出 #75752042


ソースコード 拡げる

import sys
input = sys.stdin.readline
mod = 998244353

for _ in range(int(input())):
    n = int(input())
    L = list(map(int,input().split()))
    M = [i+1 for i in range(n)]
    c = 0
    if L == M: c += 1
    for i in range(n):
        if L[i] == M[i]:
            c += n-i-1
            c %= mod
        else: break
    print(c)

提出情報

提出日時
問題 B - Reverse Permutation
ユーザ Cenix820
言語 Python (PyPy 3.11-v7.3.20)
得点 400
コード長 348 Byte
結果 AC
実行時間 148 ms
メモリ 179304 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 1
AC × 15
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.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
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 50 ms 79812 KiB
01_handmade_00.txt AC 148 ms 110132 KiB
01_handmade_01.txt AC 123 ms 179020 KiB
01_handmade_02.txt AC 119 ms 178560 KiB
01_handmade_03.txt AC 86 ms 108796 KiB
02_random_00.txt AC 120 ms 178664 KiB
02_random_01.txt AC 120 ms 178432 KiB
02_random_02.txt AC 121 ms 178624 KiB
02_random_03.txt AC 121 ms 178680 KiB
02_random_04.txt AC 121 ms 179276 KiB
02_random_05.txt AC 123 ms 179144 KiB
02_random_06.txt AC 123 ms 179304 KiB
02_random_07.txt AC 121 ms 178556 KiB
02_random_08.txt AC 121 ms 178916 KiB
02_random_09.txt AC 121 ms 179168 KiB