結果

問題 No.490 yukiソート
ユーザー t8m8⛄️t8m8⛄️
提出日時 2017-04-28 16:00:43
言語 Nim
(2.0.2)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 2,801 ms
コンパイル使用メモリ 68,224 KB
実行使用メモリ 7,892 KB
最終ジャッジ日時 2023-09-12 12:47:32
合計ジャッジ時間 4,783 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 3 ms
4,376 KB
testcase_08 AC 4 ms
4,376 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 3 ms
4,376 KB
testcase_11 AC 3 ms
4,376 KB
testcase_12 AC 3 ms
4,376 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 46 ms
7,892 KB
testcase_15 AC 46 ms
7,764 KB
testcase_16 AC 46 ms
7,800 KB
testcase_17 AC 46 ms
7,708 KB
testcase_18 AC 46 ms
7,760 KB
testcase_19 AC 46 ms
7,760 KB
testcase_20 AC 46 ms
7,856 KB
testcase_21 AC 46 ms
7,696 KB
testcase_22 AC 46 ms
7,780 KB
testcase_23 AC 46 ms
7,884 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils

when isMainModule:
  var
    n = stdin.readline.parseint
    a = stdin.readline.split.map(parseint)
  
  for i in 1..2*n-4:
    for j in 0..n-1:
      var
        q = j
        p = i - q
      if p < 0 or n-1 < p: continue
      if p > q:
        var tmp = p
        p = q
        q = tmp
      if a[p] > a[q]: swap(a[p], a[q])
  
  var ans = ""
  for i in 0..n-2:
    ans = ans & $a[i] & " "
  ans = ans & $a[n-1]
  echo ans
0