結果
| 問題 | No.490 yukiソート | 
| コンテスト | |
| ユーザー |  char134217728 | 
| 提出日時 | 2017-08-17 04:04:34 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 5 ms / 2,000 ms | 
| コード長 | 591 bytes | 
| コンパイル時間 | 1,181 ms | 
| コンパイル使用メモリ | 158,056 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-13 13:40:21 | 
| 合計ジャッジ時間 | 2,504 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 34 | 
コンパイルメッセージ
main.cpp:16:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
   16 | main(){
      | ^~~~
            
            ソースコード
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef set<int> si;
const int inf = 1e9;
const int mod = 1e9+7;
int n;
int a[2000];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 0, n)cin >> a[i];
  FOR(i, 1, 2*n - 3){
    FOR(j, max(0, i - n + 1), (i+1)/2){
      if(a[j] > a[i-j]) swap(a[j], a[i-j]);
    }
  }
  FOR(i, 0, n-1)cout << a[i] << " ";
  cout << a[n-1] << endl;
}
            
            
            
        