結果

問題 No.112 ややこしい鶴亀算
ユーザー nnasennnasen
提出日時 2017-09-23 02:58:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 1,681 ms
コンパイル使用メモリ 166,464 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-26 03:58:16
合計ジャッジ時間 2,687 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 WA -
testcase_11 AC 2 ms
6,944 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 WA -
testcase_22 AC 2 ms
6,944 KB
testcase_23 WA -
testcase_24 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0