結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2018-08-29 00:44:53 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 735 bytes |
コンパイル時間 | 2,465 ms |
コンパイル使用メモリ | 111,208 KB |
実行使用メモリ | 27,272 KB |
最終ジャッジ日時 | 2024-07-18 13:01:10 |
合計ジャッジ時間 | 4,511 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | AC * 2 RE * 32 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;using System.Linq;class No490{static void Main(){var n = Int32.Parse(Console.ReadLine());var num = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();for (int i = 0; i < 2*n-3; ++i){for (int p = 0; p < n - 1; ++p){var q = i - p;if (p >= q) break;if (num[p] > num[q]){var temp = num[p];num[p] = num[q];num[q] = temp;}}}foreach (var a in num){Console.Write(" ");Console.Write(a);}Console.WriteLine();}}