結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(void) {
  int n;
  cin >> n;

  vector<int> a(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum /= (n - 1);

  cout << (4 * n - sum) / 2 << " " << (sum - 2 * n) / 2 << endl;

  return 0;
}
0