結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main(){
	int n;
	cin >> n;
	int a[n], s=0;
	for(int i=0; i<n; i++){
		cin >> a[i];
		s+=a[i];
	}
	s/=n-1;
	int x=0, y=0;
	for(int i=0; i<n; i++){
		if(s-a[i]==2) x++;
		else y++;
	}
	cout << x << " " << y << endl;
	return 0;
}
0