結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
12,788 KB
testcase_01 AC 18 ms
8,592 KB
testcase_02 AC 18 ms
8,600 KB
testcase_03 AC 2,625 ms
8,500 KB
testcase_04 AC 2,721 ms
8,480 KB
testcase_05 AC 2,709 ms
8,596 KB
testcase_06 AC 2,693 ms
8,516 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