結果

問題 No.112 ややこしい鶴亀算
ユーザー chakku
提出日時 2015-09-16 02:21:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 585 bytes
コンパイル時間 464 ms
コンパイル使用メモリ 56,788 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 06:38:59
合計ジャッジ時間 1,176 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    int n;cin>>n;
    int a[64];
    for(int i=0;i<n;i++) cin>>a[i];
    int mx=0,mi=1000000;
    for(int i=0;i<n;i++){
        mx=max(mx,a[i]);
        mi=min(mi,a[i]);
    }
    if(mx==mi){
        int t=mx/(n-1);
        if(t==2) cout << n <<" " << 0 << endl;
        else cout << 0 << " " << n << endl;
    }else{
        int turu=0,kame=0;
        for(int i=0;i<n;i++){
            if(a[i]==mx) kame++;
            else turu++;
        }
        cout << turu << " " << kame << endl;
    }
    return 0;
}
0