結果

問題 No.694 square1001 and Permutation 3
ユーザー GrayCoderGrayCoder
提出日時 2018-06-09 00:11:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 398 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 29,132 KB
最終ジャッジ日時 2023-09-13 00:46:11
合計ジャッジ時間 15,932 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
29,132 KB
testcase_01 AC 18 ms
8,568 KB
testcase_02 AC 18 ms
8,460 KB
testcase_03 AC 2,626 ms
8,628 KB
testcase_04 AC 2,697 ms
8,552 KB
testcase_05 AC 2,729 ms
8,472 KB
testcase_06 AC 2,673 ms
8,452 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
from sys import stdin

def main():
    N = int(input())
    A = stdin.read().splitlines()
    A = list(map(int, A))
    a = deque(A)

    for _ in range(N):
        print(program(list(a), N))
        a.rotate(-1)

def program(a, n):
    cnt = 0
    for i in range(1, n):
        for j in a[:i]:
            if j > a[i]:
                cnt += 1
    return cnt

main()
0