結果

問題 No.79 過小評価ダメ・ゼッタイ
コンテスト
ユーザー asdfghjkl;
提出日時 2020-03-18 02:38:39
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -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
結果
RE  
実行時間 -
コード長 754 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 206 ms
コンパイル使用メモリ 42,324 KB
最終ジャッジ日時 2026-02-22 05:29:34
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 11 RE * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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