結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
![]() |
提出日時 | 2016-10-06 19:18:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 540 bytes |
コンパイル時間 | 1,909 ms |
コンパイル使用メモリ | 173,860 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-21 18:58:23 |
合計ジャッジ時間 | 2,383 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 WA * 12 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> vc(N); for( auto &&x : vc ) { cin >> x; } auto tmp = minmax_element( vc.begin(), vc.end() ); int kame{}, tsuru{}; for( const auto &x : vc ) { if( *tmp.first == x ) tsuru++; else kame++; } if( set<int>( begin( vc ), end( vc ) ).size() == 1 ) { if( ( *tmp.first + 2 ) / 2 == N ) { cout << N << " " << 0 << endl; return 0; } cout << 0 << " " << N << endl; return 0; } cout << tsuru << " " << kame << endl; return 0; }