結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
28,948 KB
testcase_01 AC 17 ms
8,564 KB
testcase_02 AC 17 ms
8,520 KB
testcase_03 AC 2,461 ms
8,564 KB
testcase_04 AC 2,636 ms
8,664 KB
testcase_05 AC 2,627 ms
8,556 KB
testcase_06 AC 2,540 ms
8,588 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