結果
| 問題 | No.490 yukiソート |
| コンテスト | |
| ユーザー |
omi_UT
|
| 提出日時 | 2017-03-10 22:38:17 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 116 ms / 2,000 ms |
| コード長 | 722 bytes |
| 記録 | |
| コンパイル時間 | 1,568 ms |
| コンパイル使用メモリ | 82,912 KB |
| 実行使用メモリ | 47,644 KB |
| 最終ジャッジ日時 | 2026-03-10 12:30:39 |
| 合計ジャッジ時間 | 4,587 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
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(i-p<n){
if(a[p] > a[i-p]){
int temp = a[p];
a[p] = a[i-p];
a[i-p] = temp;
}}
}
}
System.out.print(a[0]);
for(int i=1; i<n; i++){
System.out.print(" "+a[i]);
}
System.out.println();
}
}
omi_UT