結果
問題 | No.112 ややこしい鶴亀算 |
ユーザー |
|
提出日時 | 2017-09-23 02:58:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 628 bytes |
コンパイル時間 | 1,978 ms |
コンパイル使用メモリ | 168,780 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 16:28:28 |
合計ジャッジ時間 | 2,919 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 WA * 12 |
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define FOR(i,a,b) for(int i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define SZ(n) (int)(n).size() #define ALL(n) (n).begin(), (n).end() using namespace std; typedef long long LL; typedef vector<int> VI; int main() { int n; cin >> n; int t[50]; REP(i, n) cin >> t[i]; sort(t, t + n); int cnt1 = 0; REP(i, n) if (t[0] == t[i]) cnt1++; int cnt2 = n - cnt1; if (t[0] == t[n - 1]) { if (t[0] / (n - 1) == 2) { cnt1 = max(cnt1, cnt2); cnt2 = 0; } else { cnt2 = max(cnt1, cnt2); cnt1 = 0; } } cout << cnt1 << " " << cnt2 << endl; return 0; }