結果

問題 No.490 yukiソート
ユーザー rapurasurapurasu
提出日時 2017-03-10 23:47:17
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 738 bytes
コンパイル時間 1,558 ms
コンパイル使用メモリ 144,468 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-09-06 16:05:27
合計ジャッジ時間 5,138 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘LL swap(LL*, LL*)’:
main.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int n;
LL a[100001];
LL swap(LL *a,LL *b){
   LL temp=*a;
   *a=*b;
   *b=temp;
}
int main(){
	cin>>n;
	REP(i,n){
	   cin>>a[i];
	}
	REP(i,2*n-3){
	    if(i==0)continue;
	    REP(j,n){
	        int k=i-j;
	        if(k<0)continue;
	        if(k>=n)continue;
	        if(a[min(j,k)]>a[max(j,k)])swap(&a[j],&a[k]);
	    }
	}
	REP(i,n){
            cout<<a[i];
            if(i!=n-1){
               cout<<" ";
            }else{
               cout<<endl;
            }
        }
	return(0);
}
0