結果

問題 No.564 背の順
ユーザー RadPeriaRadPeria
提出日時 2017-12-02 23:59:16
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 1,005 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 29,824 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-06 01:59:25
合計ジャッジ時間 735 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main(){
        int A,N;
        scanf("%d%d",&A,&N );
        int i;
        int B[N];
        for(i=1;i<N;i++){
                scanf("%d",&B[i] );
        }
        int count=1;
        for(i=1;i<N;i++){
                if(A<B[i]){
                        count++;
                }
        }
        for(i=0;i<=9;i++){
                if(count==100){
                        printf("%dth\n",count);
                        break;
                }else if(count==i*10+1){
                        printf("%dst\n",count);
                        break;
                }else if(count==i*10+2){
                        printf("%dnd\n",count);
                        break;
                }else if(count==i*10+3){
                        printf("%drd\n",count);
                        break;
                }else{
                        printf("%dth\n",count );
                        break;
                }
        }
        return 0;
}
0