結果

問題 No.112 ややこしい鶴亀算
ユーザー Yut176
提出日時 2016-10-07 23:23:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 472 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 74,256 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 19:58:29
合計ジャッジ時間 1,939 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;

int main(){

  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0; i<n; i++) cin >> a[i];

  int s = accumulate(a.begin(), a.end(), 0);
  s /= (n-1);

  int x = 0;
  int y = 0;

  y = s / 2 -  n;
  x = n - y;

  cout << x << " " << y << endl;

  return 0;
}
0