結果

問題 No.112 ややこしい鶴亀算
ユーザー focusfocus
提出日時 2018-02-23 23:58:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 548 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 75,888 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 11:52:39
合計ジャッジ時間 1,455 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int N,turu=0,kame=0;
    cin >> N;
    vector<int> vc(N);
    for(int i=0;i<N;i++)    cin >> vc[i];
    sort(vc.begin(),vc.end());
    if(vc[0]==vc[N-1]){
        if((N-1)*4==vc[0]) kame=N;
        else    turu = N;
    }
    else{
        for(kame=1;;kame++){
            if(vc[kame-1]!=vc[kame]){
                kame++;
                break;
            }
        }
        turu = N-kame;
    }
    cout << turu << " " << kame << endl;
    return 0;
}
0