結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
kei
|
| 提出日時 | 2016-08-15 17:46:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 368 bytes |
| コンパイル時間 | 395 ms |
| コンパイル使用メモリ | 53,824 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-07 17:43:40 |
| 合計ジャッジ時間 | 1,226 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 WA * 5 |
ソースコード
#include <iostream>
using namespace std;
int main() {
int N;
int a[50];
int x = 0, y = 0;
int count = 1;
cin >> N;
cin >> a[0]; x = a[0];
for (int i = 1; i < N;i++) {
cin >> a[i];
if (x != a[i]) { y = a[i]; }
else { count++; }
}
if (x >= y) { cout << count << " " << N - count << endl; }
else { cout << N - count << " " << count << endl; }
return 0;
}
kei