結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー asdfghjkl;asdfghjkl;
提出日時 2020-03-18 02:38:39
言語 C
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 754 bytes
コンパイル時間 1,487 ms
コンパイル使用メモリ 29,156 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-20 19:38:28
合計ジャッジ時間 4,995 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 12 ms
4,384 KB
testcase_06 AC 0 ms
4,384 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 RE -
testcase_09 AC 1 ms
4,388 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 AC 0 ms
4,380 KB
testcase_14 RE -
testcase_15 AC 4 ms
4,384 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 9 ms
4,380 KB
testcase_20 AC 17 ms
4,384 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

 int cmp(const void *a,const void *b){
    if(*(int*)a>*(int*)b){return 1;}
    else if(*(int*)a<*(int*)b){return -1;}
    else {return 0;}
}

int l[100005];





int main(void){
int now=0,max=0,level=0;
int n;
scanf("%d",&n);

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

qsort(l,n,sizeof(int),cmp);



for(int i=1;;i++){
    if(n==i){
            if(now>=max){max=now;
            if(l[i-1]>=level){
                level=l[i-1];
            }
            break;
    }
    }
    if(l[i]==l[i-1]){now++;}
    else {
        if(now>=max){max=now;
            if(l[i-1]>=level){
                level=l[i-1];
            }
        }
    now=0;
    }
}
printf("%d\n",level);


}
0