結果

問題 No.490 yukiソート
ユーザー omi_UT
提出日時 2017-03-10 22:28:53
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 805 bytes
コンパイル時間 2,160 ms
コンパイル使用メモリ 75,636 KB
実行使用メモリ 53,988 KB
最終ジャッジ日時 2024-06-24 09:57:33
合計ジャッジ時間 6,865 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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; p<n-1; p++){
//				for(int q=p+1;q<n; q++){
//					if(a[p] > a[q]){
//						int temp = a[p];
//						a[p] = a[q];
//						a[q] = 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