結果

問題 No.490 yukiソート
ユーザー NoNo
提出日時 2017-05-28 00:07:21
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,437 bytes
コンパイル時間 976 ms
コンパイル使用メモリ 111,372 KB
実行使用メモリ 33,872 KB
最終ジャッジ日時 2023-10-21 13:21:56
合計ジャッジ時間 5,855 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
29,868 KB
testcase_01 AC 26 ms
25,520 KB
testcase_02 AC 27 ms
25,520 KB
testcase_03 AC 27 ms
25,520 KB
testcase_04 AC 69 ms
25,880 KB
testcase_05 AC 66 ms
25,880 KB
testcase_06 AC 65 ms
25,880 KB
testcase_07 AC 66 ms
25,880 KB
testcase_08 AC 66 ms
25,880 KB
testcase_09 AC 66 ms
25,880 KB
testcase_10 AC 64 ms
25,880 KB
testcase_11 AC 65 ms
25,880 KB
testcase_12 AC 62 ms
25,880 KB
testcase_13 AC 62 ms
25,880 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
namespace Yuki
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(z => int.Parse(z)).ToArray();

            for (int i = 1; i < 2 * n - 3; i++)
            {
                var lip = new List<int>();
                var liq = new List<int>();
                for (int p = 0; p < n - 1; p++)
                {
                    bool f = true;

                    for (int q = p + 1; q < n; q++)
                    {
                        if (p + q == i)
                        {
                            lip.Add(p);
                            liq.Add(q);
                            break;
                        }
                    }
                }

                for (int j = 0; j < lip.Count; j++)
                {
                    if (a[lip[j]] > a[liq[j]])
                    {
                        int w = a[lip[j]];
                        a[lip[j]] = a[liq[j]];
                        a[liq[j]] = w;
                    }
                }
            }

            var sb = new StringBuilder();
            foreach (var item in a)
            {
                sb.Append(item.ToString() + " ");
            }

            Console.WriteLine(sb.ToString().Trim());
        }
    }
}
0