結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
![]() |
提出日時 | 2014-12-24 16:07:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 694 bytes |
コンパイル時間 | 582 ms |
コンパイル使用メモリ | 56,168 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 04:55:15 |
合計ジャッジ時間 | 1,329 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 9 WA * 14 |
ソースコード
#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 << turu << " " << kame << std::endl; else std::cout << kame << " " << turu << std::endl; } else{ if (turu*2+kame*4==turun) std::cout << kame << " " << turu << std::endl; else std::cout << turu << " " << kame << std::endl; } return 0; }