結果

問題 No.490 yukiソート
ユーザー omi_UT
提出日時 2017-03-10 22:35:59
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 726 bytes
コンパイル時間 2,718 ms
コンパイル使用メモリ 80,760 KB
実行使用メモリ 53,668 KB
最終ジャッジ日時 2024-06-24 10:05:02
合計ジャッジ時間 5,553 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other AC * 2 RE * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		String line[] = br.readLine().split(" ");
		int[] a = new int [n];

		for (int i=0;i<n;i++){
			a[i] = Integer.parseInt(line[i]);
		}

		for(int i=0; i<2*n-3; i++){
			for(int p=0; 2*p<i; p++){
				if(a[p] > a[i-p]){
					int temp = a[p];
					a[p] = a[i-p];
					a[i-p] = temp;
				}
			}
		}
//		Arrays.sort(a);

		System.out.print(a[0]);
		for(int i=1; i<n; i++){
			System.out.print(" "+a[i]);
		}
		System.out.println();
	}
}
0