結果
問題 | No.112 ややこしい鶴亀算 |
ユーザー |
![]() |
提出日時 | 2015-04-08 21:53:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 463 bytes |
コンパイル時間 | 1,607 ms |
コンパイル使用メモリ | 164,948 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 13:19:42 |
合計ジャッジ時間 | 2,177 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include "bits/stdc++.h" using namespace std; int main(){ int N; cin >> N; int low = 9999, high = 0, sum = 0; map<int, int> m; for (int i = 0; i < N; i++) { int temp; cin >> temp; low = min(temp, low); high = max(temp, high); sum += temp; m[temp]++; } if (m.size() == 2){ cout << m[high] << " " << m[low] << endl; } else{ if (sum / N / N >= 2){ cout << 0 << " " << N << endl; } else{ cout << N << " " << 0 << endl; } } }