結果

問題 No.112 ややこしい鶴亀算
ユーザー ldsyb
提出日時 2016-03-01 10:50:19
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 58,416 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 13:02:33
合計ジャッジ時間 1,351 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
   int n,maxleg = 0,minleg = 51;
   cin >> n;
   for(int i = 0;i < n;i++){
      int a;
      cin >> a;
      maxleg = max(maxleg,a);
      minleg = min(minleg,a);
   }
   if(maxleg == minleg){
      if(maxleg / (n - 1) == 2) cout << n << " 0" << endl;
      else cout << "0 " << n << endl;
   }else cout << maxleg / n / n << ' ' << n - maxleg / n / n << endl;
}
0