結果

問題 No.564 背の順
ユーザー HaijinnHaijinn
提出日時 2018-02-02 18:11:22
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 631 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 24,816 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-30 01:35:45
合計ジャッジ時間 846 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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(strchr(s,'3')){
	printf("%srd\n",s);
	}else if(strchr(s,'2')){
	
	printf("%snd\n",s);
	
}else if(strchr(s,'1')){
	printf("%sst\n",s);
	
}else{
	
	printf("%sth\n",s);
}
	return 0;
}
0