結果

問題 No.112 ややこしい鶴亀算
ユーザー やまぞう
提出日時 2015-04-18 02:10:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 264 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 54,864 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-04 16:09:15
合計ジャッジ時間 1,685 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
	int n;
	cin >> n;
	int a;
	int sum_a = 0;
	for (int i = 0; i < n; i++) {
		cin >> a;
		sum_a += a;
	}
	int sum_x = sum_a / (n - 1);
	int t = 2 * n - sum_x / 2;
	int k = n - t;
	cout << t << " " << k << endl;
}
0