結果

問題 No.694 square1001 and Permutation 3
ユーザー GrayCoderGrayCoder
提出日時 2018-06-09 00:16:07
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 398 bytes
コンパイル時間 805 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 183,024 KB
最終ジャッジ日時 2023-09-13 00:52:56
合計ジャッジ時間 9,200 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
76,076 KB
testcase_01 AC 91 ms
71,808 KB
testcase_02 AC 91 ms
71,660 KB
testcase_03 AC 604 ms
76,876 KB
testcase_04 AC 721 ms
77,008 KB
testcase_05 AC 708 ms
77,096 KB
testcase_06 AC 717 ms
77,368 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