結果

問題 No.564 背の順
ユーザー monburan_0401monburan_0401
提出日時 2018-09-14 11:28:25
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 27,812 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-17 21:28:02
合計ジャッジ時間 1,084 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
int main(void){
	int N;
	int H[1000];		//	全員の身長をまとめて記録。H[0]:なま君
	int rank = 1;		//	順位
	
	scanf("%d%d",&H[0],&N);
	for(int i = 1; i < N; i++){
		scanf("%d",&H[i]);
		if(H[0] < H[i]){
			rank++;
		}
	}
	
	//	check ok
/*	for(int j = 0; j < N; j++){
		printf("%d ",H[j]);
	}
	printf("\n");
*/	
	printf("%d",rank);
	if(rank == 1){
		printf("st");
	}else if(rank == 2){
		printf("nd");
	}else if(rank == 3){
		printf("rd");
	}else {
		printf("th");
	}
	
	printf("\n");
	
	return 0;
}
0