結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
![]() |
提出日時 | 2015-04-08 21:53:13 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 463 bytes |
コンパイル時間 | 1,542 ms |
コンパイル使用メモリ | 164,824 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-04 13:19:39 |
合計ジャッジ時間 | 2,387 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 WA * 12 |
ソースコード
#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[low] << " " << m[high] << endl; } else{ if (sum / N / N >= 2){ cout << 0 << " " << N << endl; } else{ cout << N << " " << 0 << endl; } } }