結果

問題 No.112 ややこしい鶴亀算
ユーザー a5ua
提出日時 2014-12-24 01:18:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 483 ms
コンパイル使用メモリ 59,660 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 04:53:03
合計ジャッジ時間 1,496 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> a(N);
	for (auto &x : a) {
		cin >> x;
	}
	int F = accumulate(begin(a), end(a), 0) / (N - 1);
	int t = (4 * N - F) / 2;
	int k = N - t;
	cout << t << " " << k << endl;
}
0