結果

問題 No.490 yukiソート
ユーザー toto
提出日時 2025-03-25 17:03:22
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 27,904 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-25 17:03:24
合計ジャッジ時間 1,829 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%lld",&val);
      |         ~~~~~^~~~~~~~~~~~~
main.cpp:9:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |                 scanf("%lld",&num[i]);
      |                 ~~~~~^~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
	long long val = 0;
	scanf("%lld",&val);
	
	long long num[val];
	for(long long i = 0;i < val;i ++){
		scanf("%lld",&num[i]);
	}
	
	for(long long i = 0;i < val;i ++){
		for(long long j = 0;j < val;j ++){
			if(num[i] < num[j]){
				long long tmp = num[i];
				num[i] = num[j];
				num[j] = tmp;	
			}
		}
	}
	
	for(long long i = 0;i < val;i ++){
		printf("%lld ",num[i]);
	}
}
0