結果

問題 No.112 ややこしい鶴亀算
ユーザー Yug_min_null
提出日時 2021-11-14 22:43:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 515 bytes
コンパイル時間 3,908 ms
コンパイル使用メモリ 230,984 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-30 08:35:03
合計ジャッジ時間 4,699 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

int main(){
  int N; cin >> N;
  vector<int> A(N);
  for(int i = 0; i < N; i++) cin >> A[i];
  sort(A.begin(), A.end());
  if(A[0] == A[N-1]){
    if(A[0] == N*2-2){
      cout << N << " 0" << endl;
    }else{
      cout << "0 " << N << endl;
    }
  }else{
    for(int i = 1; i < N; i++){
      if(A[0] != A[i]){
        cout << N-i << " " << i << endl;
        break;
      }
    }
  }
}
0