結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
RCCW
|
| 提出日時 | 2017-02-04 13:47:56 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 878 bytes |
| コンパイル時間 | 811 ms |
| コンパイル使用メモリ | 89,080 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 06:14:20 |
| 合計ジャッジ時間 | 1,794 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <utility>
#include <list>
#include <functional>
#include <queue>
#include <map>
#include <iterator>
#include <iomanip>
#include <complex>
using namespace std;
using ull = unsigned long long;
using ll = long long;
int main()
{
int n;
cin >> n;
vector<ll> a(n);
ll minimum = 1e10;
ll maximum = 0;
for(auto&& x : a)
{
cin >> x;
maximum = max(maximum,x);
minimum = min(minimum,x);
}
if(maximum != minimum)
cout << count(a.begin(),a.end(),maximum) << ' ' << count(a.begin(),a.end(),minimum) << endl;
else if(maximum / (n-1) == 2)
cout << count(a.begin(),a.end(),maximum) << ' ' << 0 << endl;
else
cout << 0 << ' ' << count(a.begin(),a.end(),maximum) << endl;
}
RCCW