結果
| 問題 |
No.490 yukiソート
|
| コンテスト | |
| ユーザー |
mencotton
|
| 提出日時 | 2018-03-19 20:28:39 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 850 bytes |
| コンパイル時間 | 1,014 ms |
| コンパイル使用メモリ | 105,088 KB |
| 実行使用メモリ | 36,864 KB |
| 最終ジャッジ日時 | 2024-06-11 14:46:47 |
| 合計ジャッジ時間 | 5,905 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | AC * 14 TLE * 1 -- * 19 |
コンパイルメッセージ
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;
namespace _490
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
for (int i = 1; i < 2 * n - 3; i++)
{
for (int p = 0; p <= n - 1; p++)
{
for (int q = p + 1; q <= n - 1; q++)
{
if (p + q == i)
{
if (x[p] > x[q])
{
int a = x[p]; x[p] = x[q]; x[q] = a;
}
}
}
}
}
Console.WriteLine(string.Join(" ",x));
}
}
}
mencotton