結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
jokin_tokei
|
| 提出日時 | 2017-09-08 23:12:39 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 610 bytes |
| コンパイル時間 | 593 ms |
| コンパイル使用メモリ | 30,080 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 12:14:15 |
| 合計ジャッジ時間 | 1,498 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#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;
}
jokin_tokei