結果

問題 No.564 背の順
ユーザー HaijinnHaijinn
提出日時 2018-02-02 18:13:55
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 883 ms
コンパイル使用メモリ 25,028 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-30 01:35:48
合計ジャッジ時間 863 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 0 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
4,376 KB
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>
int main(void)
{
	int h,n;
	int h2[102];
	int c=1;
	int i;
	int temp;
	int j;
	char s[1000];
	scanf("%d%d",&h,&n);
	for(i=0;i<n-1;i++){
		
		scanf("%d",&h2[i]);
		
	}
	for(i=0;i<n-1;i++){
		for(j=n-2;j>i;j--){
			if(h2[j]>h2[j-1]){
				temp=h2[j];
				h2[j]=h2[j-1];
				h2[j-1]=temp;
			}
		}
	}
	for(i=0;i<n-1;i++){
		if(h2[i]>h){
			
			
			c++;
			
			
		}
		
		
		
		
		
		
		
		
	}
	sprintf(s,"%d",c);
	if(s[strlen(s)]=='3'){
	printf("%srd\n",s);
	}else if(s[strlen(s)]=='2'){
	
	printf("%snd\n",s);
	
}else if(s[strlen(s)]=='1'){
	printf("%sst\n",s);
	
}else{
	
	printf("%sth\n",s);
}
	return 0;
}
0