結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
machy
|
| 提出日時 | 2015-06-11 12:51:43 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 558 bytes |
| コンパイル時間 | 478 ms |
| コンパイル使用メモリ | 73,064 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 15:35:05 |
| 合計ジャッジ時間 | 1,199 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long LL;
int main(){
int N;
cin >> N;
vector<int> a(N);
LL total = 0;
for(int i = 0; i < N; i++){
cin >> a[i];
total += a[i];
}
total /= N-1;
LL ans1 = 0;
LL ans2 = 0;
for(int i = 0; i < N; i++){
if(total - a[i] == 2){
ans1++;
}else{
ans2++;
}
}
cout << ans1 << " " << ans2 << endl;
return 0;
}
machy