結果

問題 No.490 yukiソート
ユーザー mMqrMruYrNII4TdmMqrMruYrNII4Td
提出日時 2017-03-10 22:23:50
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 59,692 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-24 08:22:51
合計ジャッジ時間 1,489 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |         REP(i,n) scanf("%d", &a[i]);
      |                  ~~~~~^~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)

typedef long long ll;

int a[5001];

int main(){
	int n;
	
	cin >> n;
	
	REP(i,n) scanf("%d", &a[i]);
	
	sort(a,a+n);
	
	REP(i,n){
		printf("%d", a[i]);
		if (i != n-1) printf(" ");
		else puts("");
	}
	
	return 0;
}
0