結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
dora_maruta
|
| 提出日時 | 2014-12-24 16:09:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 702 bytes |
| コンパイル時間 | 569 ms |
| コンパイル使用メモリ | 55,320 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 04:55:35 |
| 合計ジャッジ時間 | 1,276 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 WA * 7 |
ソースコード
#include<iostream>
int m[50*4+1];
int main(){
int n;
std::cin >> n;
for (int i = 0; i < n; ++i){
int a;
std::cin >> a;
m[a]++;
}
int cnt = 0;
int turu = 0;
int kame = 0;
int turun = 0;
int kamen = 0;
for (int i = 0; i < 201; ++i){
if (m[i] != 0){
turu == 0 ? turu = m[i] : kame = m[i];
turun == 0 ? turun = i : kamen = i;
}
}
if (turun>kamen)std::swap(turun, kamen);
if (kame == 0){
if (turu * 2 == turun)std::cout << kame << " " << turu << std::endl;
else std::cout << turu << " " << kame << std::endl;
}
else{
if (turu * 2 + kame * 4 == turun) std::cout << turu << " " << kame << std::endl;
else std::cout << kame << " " << turu << std::endl;
}
return 0;
}
dora_maruta