結果

問題 No.564 背の順
コンテスト
ユーザー jokin_tokei
提出日時 2017-09-08 23:12:39
言語 C(gnu17)
(gcc 15.3.0)
コンパイル:
gcc-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 40µs
コード長 610 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 313 ms
コンパイル使用メモリ 38,736 KB
実行使用メモリ 9,788 KB
最終ジャッジ日時 2026-10-15 18:20:33
合計ジャッジ時間 1,623 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdlib.h>

#define THOUSAND 1000

void order() {
	int nama_height = 0, num = 0;
	int other_height[THOUSAND] = { };
	int i, j;

	int rank = 1;

	scanf("%d %d\n", &nama_height, &num);

	for (i = 0; i < num; i++) {
			scanf("%d\n", &other_height[i]);
	}

	for (j = 0; j < num - 1; j++) {
		if (nama_height < other_height[j]) {
			rank++;
		}
	}

	printf("%d", rank);

	switch (rank % 10) {
	case 1:
		printf("st\n");
		break;
	case 2:
		printf("nd\n");
		break;
	case 3:
		printf("rd\n");
		break;
	default:
		printf("th\n");
		break;
	}

}

int main(void) {

	order();

	return 0;
}
0