結果
問題 | No.490 yukiソート |
ユーザー | 14番 |
提出日時 | 2017-03-10 22:40:43 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 1,634 bytes |
コンパイル時間 | 2,294 ms |
コンパイル使用メモリ | 105,592 KB |
実行使用メモリ | 24,320 KB |
最終ジャッジ日時 | 2023-09-06 15:44:14 |
合計ジャッジ時間 | 6,298 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 65 ms
21,848 KB |
testcase_01 | AC | 66 ms
21,904 KB |
testcase_02 | AC | 67 ms
21,908 KB |
testcase_03 | AC | 66 ms
23,976 KB |
testcase_04 | AC | 74 ms
22,072 KB |
testcase_05 | AC | 73 ms
21,996 KB |
testcase_06 | AC | 72 ms
22,044 KB |
testcase_07 | AC | 73 ms
24,128 KB |
testcase_08 | AC | 73 ms
22,112 KB |
testcase_09 | AC | 72 ms
20,012 KB |
testcase_10 | AC | 72 ms
22,052 KB |
testcase_11 | AC | 71 ms
24,092 KB |
testcase_12 | AC | 71 ms
22,112 KB |
testcase_13 | AC | 70 ms
22,008 KB |
testcase_14 | AC | 82 ms
22,292 KB |
testcase_15 | AC | 81 ms
22,232 KB |
testcase_16 | AC | 81 ms
22,224 KB |
testcase_17 | AC | 81 ms
24,276 KB |
testcase_18 | AC | 81 ms
22,152 KB |
testcase_19 | AC | 82 ms
24,320 KB |
testcase_20 | AC | 81 ms
22,164 KB |
testcase_21 | AC | 81 ms
22,212 KB |
testcase_22 | AC | 80 ms
22,220 KB |
testcase_23 | AC | 81 ms
22,220 KB |
testcase_24 | AC | 64 ms
19,704 KB |
testcase_25 | AC | 63 ms
21,976 KB |
testcase_26 | AC | 63 ms
21,888 KB |
testcase_27 | AC | 63 ms
21,856 KB |
testcase_28 | AC | 63 ms
21,912 KB |
testcase_29 | AC | 64 ms
21,892 KB |
testcase_30 | AC | 64 ms
21,848 KB |
testcase_31 | AC | 63 ms
23,932 KB |
testcase_32 | AC | 63 ms
23,916 KB |
testcase_33 | AC | 63 ms
21,868 KB |
testcase_34 | AC | 63 ms
21,868 KB |
testcase_35 | AC | 64 ms
21,876 KB |
コンパイルメッセージ
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; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Text; public class Program { public void Proc() { Reader.IsDebug = false; int n = int.Parse(Reader.ReadLine()); long[] arr = Reader.ReadLine().Split(' ').Select(a=>long.Parse(a)).ToArray(); for(int i=1; i<2*n-3; i++) { for(int j=0; j<n; j++) { int idx1 = j; int idx2 = i-j; if(idx2 < idx1) { break; } if(idx2 >= n) { continue; } if(arr[idx1] > arr[idx2]) { Swap(arr, idx1, idx2); } } } Console.WriteLine(string.Join(" ", arr)); } private void Swap(long[] arr, int idx1, int idx2) { long num = arr[idx1]; arr[idx1] = arr[idx2]; arr[idx2] = num; } public class Reader { public static bool IsDebug = true; private static System.IO.StringReader SReader; private static string InitText = @" 15 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 "; public static string ReadLine() { if(IsDebug) { if(SReader == null) { SReader = new System.IO.StringReader(InitText.Trim()); } return SReader.ReadLine(); } else { return Console.ReadLine(); } } } public static void Main(string[] args) { Program prg = new Program(); prg.Proc(); } }