結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
29,228 KB
testcase_01 AC 18 ms
8,436 KB
testcase_02 AC 18 ms
8,412 KB
testcase_03 AC 2,592 ms
8,460 KB
testcase_04 AC 2,620 ms
8,688 KB
testcase_05 AC 2,608 ms
8,492 KB
testcase_06 AC 2,585 ms
8,688 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