結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
hotpepsi
|
| 提出日時 | 2015-01-06 23:00:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 400 bytes |
| コンパイル時間 | 632 ms |
| コンパイル使用メモリ | 59,056 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-13 02:43:42 |
| 合計ジャッジ時間 | 1,437 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <iostream>
#include <sstream>
#include <numeric>
using namespace std;
int main(int argc, char *argv[])
{
string s;
getline(cin, s);
int N = atoi(s.c_str());
getline(cin, s);
stringstream ss(s);
int n[100];
for (int i = 0; i < N; ++i) {
ss >> n[i];
}
int sum = accumulate(n, n + N, 0) / (N - 1) / 2;
int b = sum - N;
int a = N - b;
cout << a << " " << b << endl;
return 0;
}
hotpepsi